PewN Posted September 30, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Share Posted September 30, 2012 (edited) how can i make it 30 days? function script F_VIPstart { set .@ticks, getarg(0, "15"); // getarg(0) = ticks (seconds) if (.@ticks <= 0) { debugmes "F_VIPstart - tried to set a timer in the past"; end; } // set a variable, #VIP_expire, as the Unixtime when this expires set #VIP_expire, gettimetick(2) + .@ticks; // add a timer with that tick (in case they stay logged in that long) if (.@ticks < 2147483) { // prevent overflow error addtimer .@ticks *1000, "vip_rental::OnVIPend"; } else { addtimer 2147483, "vip_rental::OnVIPcheck"; } // change them to GM level 1 atcommand "@adjgroup 1 "+strcharinfo(0); dispbottom "You now have access to VIP commands!"; return; } - script vip_rental -1,{ OnPCLoginEvent: if (#VIP_expire > gettimetick(2)) { // timer in future dispbottom "VIP Rental : expires in " + callfunc("Time2Str",#VIP_expire); atcommand "@adjgroup 1 "+strcharinfo(0); } OnVIPcheck: if (#VIP_expire > gettimetick(2)) { if ((#VIP_expire - gettimetick(2)) < 2147483) { // prevent overflow error addtimer (#VIP_expire - gettimetick(2)) *1000, strnpcinfo(3)+"::OnVIPend"; } else { addtimer 2147483, strnpcinfo(3)+"::OnVIPcheck"; } } else if (#VIP_expire) { // timer already expired doevent strnpcinfo(3)+"::OnVIPend"; } end; OnVIPend: // change them to GM level 0 atcommand "@adjgroup 0 "+strcharinfo(0); set #VIP_expire, 0; // clear timer dispbottom "Your VIP Rental has expired."; end; } Edited September 30, 2012 by Emistry Please use [CODEBOX] or Attachments for long contents. Quote Link to comment Share on other sites More sharing options...
Brian Posted September 30, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted September 30, 2012 http://www.eathena.ws/board/index.php?act=findpost&pid=1386316 Usage: { callfunc "F_VIPstart", <ticks>; } ticks = how long their VIP will last, in seconds. (this can be used in an item script or NPC) Examples: 1 day = 86400 7 days = 604800 14 days = 1209600 30 days = 2592000 seconds, so the item script would be: { callfunc "F_VIPstart", 2592000; } Quote Link to comment Share on other sites More sharing options...
PewN Posted October 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted October 1, 2012 http://www.eathena.w...ost&pid=1386316 Usage: { callfunc "F_VIPstart", <ticks>; } ticks = how long their VIP will last, in seconds. (this can be used in an item script or NPC) Examples: 1 day = 86400 7 days = 604800 14 days = 1209600 30 days = 2592000 seconds, so the item script would be: { callfunc "F_VIPstart", 2592000; } thx a lot for this script and your help to me i found this code by checking all Admin Profile hehehe Quote Link to comment Share on other sites More sharing options...
Question
PewN
how can i make it 30 days?
Edited by EmistryPlease use [CODEBOX] or Attachments for long contents.
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.