Takuyakii Posted September 1, 2022 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
0 Akkarin Posted September 1, 2022 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
0 Takuyakii Posted September 1, 2022 Author 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
0 Akkarin Posted September 1, 2022 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
0 Takuyakii Posted September 1, 2022 Author 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
0 Akkarin Posted September 1, 2022 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
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 Takuyakii5 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.