Jump to content

Question

Posted (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 by miracle

10 answers to this question

Recommended Posts

  • 0
Posted
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

  • Upvote 1
  • 0
Posted
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$;

 

  • Upvote 1
  • 0
Posted (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 by miracle
  • 0
Posted

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 

  • 0
Posted (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 by Kaze
  • 0
Posted
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

  • 0
Posted
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 ?

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...