Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===== 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;
- }
- // change them to GM level 1
- atcommand "@adjgmlvl 1 "+strcharinfo(0);
- query_sql "UPDATE login SET `level`=1 WHERE account_id="+getcharid(3);
- dispbottom "You now have access to VIP commands! Take note doing rates will not changes the infos given by the server as regular rate but it will automatically add in your exp and drop rates.";
- // set a variable, #VIP_expire, as the Unixtime (gettimetick(2)) 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 < 2592000) { // prevent overflow error
- addtimer .@ticks *1000, "vip_rental::OnVIPend";
- }
- return;
- }
- - script vip_rental -1,{
- OnPCLoginEvent:
- if (#VIP_expire > gettimetick(2)) {
- // timer in future
- if ((#VIP_expire - gettimetick(2)) < 2592000) { // prevent overflow error
- Announce("Your VIP Rental stays active, Bonus exp 100% and 150% Bonus for drop rates," + (#VIP_expire - gettimetick(2)) + " remaining seconds.", BC_SELF);
- addtimer (#VIP_expire - gettimetick(2)) *1000, "vip_rental::OnVIPend";
- }
- } else if (#VIP_expire) {
- // timer already expired
- doevent "vip_rental::OnVIPend";
- }
- end;
- OnVIPend:
- // change them to GM level 0
- atcommand "@adjgmlvl 0 "+strcharinfo(0);
- query_sql "UPDATE login SET `level`=0 WHERE account_id="+getcharid(3);
- set #VIP_expire, 0; // clear timer
- dispbottom "Your VIP Rental has expired.";
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement