prontera,164,169,3 script Premium Trader 757,{
mes "Want to be Premium User for 1 week?";
mes "Then give me 7 x "+getitemname(7179);
next;
if( countitem(7179) >= 7 ) {
if( select("YES:NO") == 1 ){
delitem 7179,7;
callfunc "F_VIPstart",604800;
mes "Done. enjoy your Premium Services for 1 Week.";
}
}
close;
}
function script F_VIPstart {
set .@ticks,getarg(0); // getarg(0) = ticks (seconds)
if (.@ticks <= 0) {
debugmes "F_VIPstart - tried a negative time";
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";
}
}