miracle Posted May 19, 2017 Posted May 19, 2017 (edited) im trying to change this freebies script by ip into if lastlogin < 2016-06-02 date but not work . can help me to fix it ? Spoiler amatsu,116,146,3 script Seyra 90,{ set .@n$, "[Seyra]"; setarray .@rwd[0],2115,1,2357,1,2421,1,2524,1; // Rewards: <item id>,<item amount> query_sql ("SELECT account_id FROM login WHERE lastlogin =" + getcharid(3) + "", .@lip$); if ( getd("$" + .@lip$ + "_NG") < 2016-06-02 || #NewbieGift > 0) { mes .@n$; mes "I'm sorry, the rewards are exclusively for new players."; close; } mes .@n$; mes "Welcome! Here are some free gifts"; mes "for newcomers:"; for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 ) mes .@rwd[.@i+1] + " x " + getitemname(.@rwd[.@i]); close2; set #NewbieGift, 1; setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1; for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 ) getitem .@rwd[.@i], .@rwd[.@i+1]; end; OnInit: waitingroom "Newbie Gift!",0; end; } thanks Edited May 19, 2017 by miracle Quote
0 Cyro Posted July 22, 2017 Posted July 22, 2017 8 minutes ago, miracle said: i got some idea . how if the requirment is from account_id ?? if account_id < 2080000 get reward . can someone help me to running this script ? Try using search function, there is more similar scripts 1 Quote
0 Cyro Posted May 20, 2017 Posted May 20, 2017 query_sql "select date_format( lastlogin , '%l.%i%p %e/%c/%Y' ) from login right join `char` on `char`.account_id = login.account_id where `char`.name =" + getcharid(0) + "",.@lip$; 1 Quote
0 miracle Posted May 20, 2017 Author Posted May 20, 2017 (edited) 8 hours ago, Cyro said: query_sql "select date_format( lastlogin , '%l.%i%p %e/%c/%Y' ) from login right join `char` on `char`.account_id = login.account_id where `char`.name =" hello thanks for the querry , but the npc ignoring the date condition, so the npc still give reward . maybe have error condition if ( getd("$" + .@lip$ + "_NG") < 02-06-2016 || #NewbieGift > 0) { mes .@n$; mes "I'm sorry, the rewards are exclusively for new players."; close; } Edited May 20, 2017 by miracle Quote
0 Cyro Posted June 5, 2017 Posted June 5, 2017 I tried this in different ways, and found out its not possible to make it work, Since as soon as player login to map server it will be auto updated last login to your database Quote
0 Deleted User Posted June 5, 2017 Posted June 5, 2017 (edited) 52 minutes ago, Cyro said: I tried this in different ways, and found out its not possible to make it work, Since as soon as player login to map server it will be auto updated last login to your database I'm not sure maybe check, when the Accounts is being registered. seems like it's more likely logical. Edited June 5, 2017 by Kaze Quote
0 Cyro Posted June 5, 2017 Posted June 5, 2017 2 minutes ago, Kaze said: I'm not sure maybe check, when the Accounts is being registered. seems like it's more likely logical. well some of the old players might be still playing, so we cant call it welcome back when they actually playing Quote
0 miracle Posted July 22, 2017 Author Posted July 22, 2017 On 6/6/2017 at 1:04 AM, Kaze said: I'm not sure maybe check, when the Accounts is being registered. seems like it's more likely logical. On 6/6/2017 at 1:07 AM, Cyro said: well some of the old players might be still playing, so we cant call it welcome back when they actually playing i got some idea . how if the requirment is from account_id ?? if account_id < 2080000 get reward . can someone help me to running this script ? Quote
Question
miracle
im trying to change this freebies script by ip into if lastlogin < 2016-06-02 date but not work . can help me to fix it ?
amatsu,116,146,3 script Seyra 90,{
set .@n$, "[Seyra]";
setarray .@rwd[0],2115,1,2357,1,2421,1,2524,1; // Rewards: <item id>,<item amount>
query_sql ("SELECT account_id FROM login WHERE lastlogin =" + getcharid(3) + "", .@lip$);
if ( getd("$" + .@lip$ + "_NG") < 2016-06-02 || #NewbieGift > 0)
{
mes .@n$;
mes "I'm sorry, the rewards are exclusively for new players.";
close;
}
mes .@n$;
mes "Welcome! Here are some free gifts";
mes "for newcomers:";
for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 )
mes .@rwd[.@i+1] + " x " + getitemname(.@rwd[.@i]);
close2;
set #NewbieGift, 1;
setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1;
for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 )
getitem .@rwd[.@i], .@rwd[.@i+1];
end;
OnInit:
waitingroom "Newbie Gift!",0;
end;
}
thanks
Edited by miracle10 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.