Takuyakii Posted September 1, 2022 Group: Members Topic Count: 41 Topics Per Day: 0.02 Content Count: 215 Reputation: 11 Joined: 08/30/19 Last Seen: April 23 Share Posted September 1, 2022 (edited) Hello, can someone help me make this work ? query_sql "UPDATE `char` SET name='[Dark Army] "+ escape_sql(@charname$) + "' WHERE `char_id`="+escape_sql(@charid$)+""; i have an npc that can change your name, but the sql script not working. i found that sql wayback 2013 i gueess, Edited September 1, 2022 by Takuyakii Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted September 1, 2022 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3145 Reputation: 1633 Joined: 03/26/12 Last Seen: 3 hours ago Share Posted September 1, 2022 For starters, please change the topic title - it's not as descriptive as it could be. Second, why is your script using a string variable for an integer? (charid) How are you setting these variables? Missing parenthesis: Quote query_sql("your MySQL query"{, <array variable>{, <array variable>{, ...}}}); Quote Link to comment Share on other sites More sharing options...
0 Takuyakii Posted September 1, 2022 Group: Members Topic Count: 41 Topics Per Day: 0.02 Content Count: 215 Reputation: 11 Joined: 08/30/19 Last Seen: April 23 Author Share Posted September 1, 2022 Just now, Akkarin said: For starters, please change the topic title - it's not as descriptive as it could be. Second, why is your script using a string variable for an integer? (charid) How are you setting these variables? Missing parenthesis: Thank you sir, i tryd to searched and found out about something so i did query_sql "UPDATE `char` SET name='[Dark Army] "+ escape_sql(.@charname$) + "' WHERE `char_id`='"+getcharid(0)+"'"; and now its working, now i have a second problem, how can i maintain their original name? i would just like if they change name their original name will still exist, but in front of original name "Dark army" will show. [Dark Army] Takuyakii. Sorry for my title i just don't know what should i wrote. again sorry Sir. Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted September 1, 2022 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3145 Reputation: 1633 Joined: 03/26/12 Last Seen: 3 hours ago Share Posted September 1, 2022 You could instead just use @fakename to apply the change so it doesn't change anything in the database. OnPCLoginEvent: atcommand "@fakename [Dark Army] "+ strcharinfo(0); end; The fakename atcommand is visual only and lasts until the player logs out. Quote Link to comment Share on other sites More sharing options...
0 Takuyakii Posted September 1, 2022 Group: Members Topic Count: 41 Topics Per Day: 0.02 Content Count: 215 Reputation: 11 Joined: 08/30/19 Last Seen: April 23 Author Share Posted September 1, 2022 Just now, Akkarin said: You could instead just use @fakename to apply the change so it doesn't change anything in the database. OnPCLoginEvent: atcommand "@fakename [Dark Army] "+ strcharinfo(0); end; The fakename atcommand is visual only and lasts until the player logs out. i tried but if i use @fakename, they can't invite him into party. or guild nor duel. Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted September 1, 2022 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3145 Reputation: 1633 Joined: 03/26/12 Last Seen: 3 hours ago Share Posted September 1, 2022 Alright then, if you want to do something complicated, you will need to create a separate column in the char table and update that column with the player's name before changing it. 1 Quote Link to comment Share on other sites More sharing options...
Question
Takuyakii
Hello,
can someone help me make this work ?
query_sql "UPDATE `char` SET name='[Dark Army] "+ escape_sql(@charname$) + "' WHERE `char_id`="+escape_sql(@charid$)+"";
i have an npc that can change your name, but the sql script not working.
i found that sql wayback 2013 i gueess,
Edited by TakuyakiiLink to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.