Ninja Posted August 21, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Share Posted August 21, 2012 (edited) query_sql("update `char` SET name='[HC]"+strcharinfo(0)+"' WHERE name='"+strcharinfo(0)+"'"); basically,this attaches "[HC]" in someone's name. how do you reverse this process in a later time? @_@ Edited August 21, 2012 by jezznar Quote Link to comment Share on other sites More sharing options...
EvilPuncker Posted August 21, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Share Posted August 21, 2012 easy one: save the old name in a perm variable or a new table then just revert Quote Link to comment Share on other sites More sharing options...
skyleo Posted August 21, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 39 Reputation: 2 Joined: 08/19/12 Last Seen: April 8, 2022 Share Posted August 21, 2012 (edited) Better suggestion(cause this will use less ressources than the other solution): Just do this: set @oldname$, replacestr(strcharinfo(0), "[HC]", ""); // Would delete all [HC]s so if the name is [HC]Marvin_s[HC] it would be Marvin_s If you just want to delete the [HC] at beginning, do this: set @oldname$, substr(strcharinfo(0), 4, getstrlen(strcharinfo(0)); //Skips the first 4 Characters ([HC]) and just returns the part after the 4th character. EDIT: Uses now strcharinfo(0) instead of var. Edited August 21, 2012 by skyleo Quote Link to comment Share on other sites More sharing options...
Ninja Posted August 21, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Author Share Posted August 21, 2012 (edited) easy one: save the old name in a perm variable or a new table then just revert this is actually what I did but I think there's a better way Better suggestion(cause this will use less ressources than the other solution): Just do this: set @oldname$, replacestr(strcharinfo(0), "[HC]", ""); // Would delete all [HC]s so if the name is [HC]Marvin_s[HC] it would be Marvin_s If you just want to delete the [HC] at beginning, do this: set @oldname$, substr(strcharinfo(0), 4, getstrlen(strcharinfo(0)); //Skips the first 4 Characters ([HC]) and just returns the part after the 4th character. EDIT: Uses now strcharinfo(0) instead of var. just a question, will this remain even if I restart the server? or should I use oldname$ instead? I do want to revert names at a later time.. please educate me >_< I suck at scripting. Edited August 21, 2012 by jezznar Quote Link to comment Share on other sites More sharing options...
skyleo Posted August 21, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 39 Reputation: 2 Joined: 08/19/12 Last Seen: April 8, 2022 Share Posted August 21, 2012 (edited) It's temporary, but you don't have to save it, since you can just create this variable exactly at the point where you're deleting the [HC]. As I said in my post, it's a loss of ressources when you save things like that. Edited August 21, 2012 by skyleo Quote Link to comment Share on other sites More sharing options...
Ninja Posted August 21, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Author Share Posted August 21, 2012 i see. thanks! i missed that point. that's definitely a good one. Quote Link to comment Share on other sites More sharing options...
Question
Ninja
basically,this attaches "[HC]" in someone's name.
how do you reverse this process in a later time? @_@
Edited by jezznarLink 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.