PewN Posted September 22, 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 22, 2012 how can i add a npc here that can buy a Vip using an item. then after he buy it the vip system will start! //===== eAthena Script ======================================= //= VIP Rental System //===== By: ================================================== //= Brian //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= eAthena SVN (SQL only) //===== Description: ========================================= //= Makes a player VIP (GM level 1) for a set amount of time. //===== Additional Comments: ================================= //= //============================================================ function script F_VIPstart { set .@ticks, getarg(0); // 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 2147483000, "vip_rental::OnVIPcheck"; } // change them to GM level 1 atcommand "@adjgmlvl 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 "@adjgmlvl 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 2147483000, strnpcinfo(3)+"::OnVIPcheck"; } } else if (#VIP_expire) { // timer already expired doevent strnpcinfo(3)+"::OnVIPend"; } end; OnVIPend: // change them to GM level 0 atcommand "@adjgmlvl 0 "+strcharinfo(0); set #VIP_expire, 0; // clear timer dispbottom "Your VIP Rental has expired."; end; } Quote Link to comment Share on other sites More sharing options...
Bin4ry Posted September 22, 2012 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 782 Reputation: 82 Joined: 01/01/12 Last Seen: September 21, 2015 Share Posted September 22, 2012 (edited) Just put this script for your item script? callfunc "F_VIPstart"; Edit: Misunderstood some part, hehs. Just write your script like this to toggle your function script? map,x,y,f script VIP 50,{ function F_VIPstart; end; } Edited September 22, 2012 by darristan Quote Link to comment Share on other sites More sharing options...
Question
PewN
how can i add a npc here that can buy a Vip using an item. then after he buy it the vip system will start!
Link to comment
Share on other sites
1 answer 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.