mmjgold Posted October 9, 2016 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 11 Reputation: 0 Joined: 07/03/13 Last Seen: September 9, 2019 Share Posted October 9, 2016 (edited) hi I use this npc izlude,136,146,4 script Gift NPC 865,{ query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`= '" + getcharid(3) + "'", .@lip$); mes "[welcome]"; mes "will give u a gift once "; if(!#Freebie && ( getd("$" + .@lip$ + "_ASD") == 0 )) { mes "sure ?"; next; switch(select("good bye")) { case 1: getitem 677,20; getitem 674,2; getitem 4043,4; break; } set #Freebie, 1; setd "$" + .@lip$ + "_ASD", getd("$" + .@lip$ + "_ASD") + 1; close; } OnInit: waitingroom "Gift",0; end; } and its work great but when I want to give player new Freebie, I can't because NPC save his IP where can I rest IP so NPC give player new Freebie again ? thank you Edited October 15, 2016 by Emistry Please use CODEBOX. Quote Link to comment Share on other sites More sharing options...
0 anacondaq Posted October 9, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 1096 Reputation: 348 Joined: 02/26/12 Last Seen: May 30, 2023 Share Posted October 9, 2016 something like that: (not tested) Added extra command for GM called @reset_gift, this command will show menu for GM where GM can enter player name for reseting IP & #Freebies variable. izlude, 136, 146, 4 script Gift NPC 865, { query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`= '" + getcharid(3) + "'", .@last_ip$); mes "[welcome]"; mes "will give u a gift once "; if (!#Freebie && ( getd("$" + .@last_ip$ + "_ASD") == 0 )) { mes "sure ?"; next; switch (select("good bye")) { case 1: getitem 677, 20; getitem 674, 2; getitem 4043, 4; break; } set #Freebie, 1; setd "$" + .@last_ip$ + "_ASD", getd("$" + .@last_ip$ + "_ASD") + 1; close; } OnInit: waitingroom "Gift", 0; bindatcmd "reset_gift", strnpcinfo(3) + "::OnCommandReset", 99, 99; end; OnCommandReset: if ( getgmlevel() < 90 ) end; mes "Enter player name (player must be online) :"; input .@PlayerName$; // checking, if player Online. if (isloggedin(getcharid(3, .@PlayerName$)) { setd "$" + .@last_ip$ + "_ASD", 0; // setted variable with player IP to 0 set #Freebie, 0, getcharid(0,.@PlayerName$); // here we set #Freebie variable for entered player to 0 mes "Done!"; close; } else { mes "Player not found."; close; } end; } Quote Link to comment Share on other sites More sharing options...
0 Sryx Posted October 10, 2016 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 520 Reputation: 64 Joined: 11/19/11 Last Seen: October 19, 2024 Share Posted October 10, 2016 Idk if this what you mean. Change this line. if(!#Freebie && ( getd("$" + .@lip$ + "_ASD") == 0 )) { to (it will give freebies in every new account) if(!#Freebie) { And remove this lines. query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`= '" + getcharid(3) + "'", .@last_ip$); setd "$" + .@last_ip$ + "_ASD", getd("$" + .@last_ip$ + "_ASD") + 1; If you wan't to give freebies again in specific account you can use the given script above. Quote Link to comment Share on other sites More sharing options...
Question
mmjgold
and its work great
but when I want to give player new Freebie, I can't because NPC save his IP
where can I rest IP so NPC give player new Freebie again ?
thank you
Please use CODEBOX.
Link to comment
Share on other sites
2 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.