Jump to content
  • 0

Help me on query_sql


Limestone

Question


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   16
  • Joined:  11/21/11
  • Last Seen:  

how to put this sql script in my npc and change my name like this. for example:

From Super Hero to [ Cool ] Super Hero

thank you!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2350
  • Joined:  10/28/11
  • Last Seen:  

change permanently ??

try

.@name$ = "[Cool] "+strcharinfo(0);
query_sql( "UPDATE `char` SET `name`='"+.@name$+"' WHERE `char_id`='"+getcharid(0)+"' );

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  1479
  • Reputation:   172
  • Joined:  12/14/11
  • Last Seen:  

basically, this is a cut of the script

set .@new_name$, "[Cool] "+strcharinfo(0)+;
query_sql("UPDATE `char` SET name='"+escape_sql(.@new_name$)+"' WHERE `char_id`='"+escape_sql(getcharid(0))+"');

CMIIW

Have a nice day!

*started typing 3 hrs ago..==, able to send a minute ago

Edited by Winz
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   16
  • Joined:  11/21/11
  • Last Seen:  

hmm.. thank you emistry, i try it.. no its not permanently, how about if the name expires, what i mean, i want to put that script on my pvp ladder, but if the name expires, what should i put to revert back to its original name?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

If the player own a guild, you must uptade his name in guild table too. But I think uptade table for this is too complicated. I believe fakename is better but you aren't forced to believe me XD

prontera,150,180,5    script    I like Rabbit    456,{

   Timepgm = gettimetick(2) + 20;
   dispbottom "Display [Cool] during 20 sec.";
   end;

OnPCLoginEvent:
   if( Timepgm > gettimetick(2) )
       atcommand "@fakename [Cool] "+ strcharinfo(0);
   else
       Timepgm = 0;
   end;
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...