Jump to content
  • 0

Freebies by Date


miracle

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  08/06/12
  • Last Seen:  

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
Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  08/06/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

try 

Spoiler

if (.@lip$ < 2016-06-02)

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  08/06/12
  • Last Seen:  

hi !

got this error

Untitled.png

 

up

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  08/06/12
  • Last Seen:  

up

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

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 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   55
  • Joined:  12/02/11
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  08/06/12
  • Last Seen:  

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 ?

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...