Jump to content
  • 0
Sign in to follow this  
ahmadshidqi

Help my script please ^^

Question

Hi, i tried to make script premium service with change group_id, its work, but there something problem....

 

it doesnt work when the time is up. its my script :)

 

prontera,166,181,3	script	Premium Service	54,{	// Configs	set .itemIDP, 7280; // Set this number to the VIP ticket	set $VIP_Cooldown,60; // 60 sec Duration for test		// Don't edit this config @last - @seconds	set .@last,#VIP_Lasttime + $VIP_Cooldown - gettimetick(2);	set .@days,.@last / 60 / 60 / 24;	set .@hours,.@last / 60 / 60 % 60;	set .@minutes,.@last / 60 % 60;	set .@seconds,.@last % 60;		// Premium Service Duration	if(#VIPSERVICE == 1 && #VIP_Lasttime + $VIP_Cooldown > gettimetick(2) && #VIP_Lasttime < gettimetick(2) && getgroupid() == 1) {		mes "[Premium Service]";		mes "You have: ";		mes ""+.@days+" days "+.@hours+" hours "+.@minutes+" minutes "+.@seconds+" seconds";		mes "in your Premium Service remaining.";		close;		}			// Mainly Script Premium Service		mes "[Premium Service]";	mes "Hello!";	mes "Would you like to redeem your Premium Service ticket?";	switch(select("Yes!:No.")) {	case 1:		if (countitem(.itemIDP) > 0 && getgroupid() == 0 ) {		delitem .itemIDP,1;		set #VIPSERVICE,1;		set #VIP_Lasttime,gettimetick(2);				mes "Congrats, you now have Premium Member!";		query_sql "UPDATE `login` SET `group_id` = 1 WHERE `group_id` = 0 AND `account_id` = "+getcharid(3);		dispbottom "You must relog for it to take effect.";		next;		atcommand "@kick "+strcharinfo(0)+"";		close;		}		else if (countitem(.itemIDP) == 0) {		next;		mes "[Premium Service]";			mes "You do not have a Premium Service ticket!";		mes "Come back when you get one.";		close;		}		else {		next;		mes "[Premium Service]";				mes "Only player can using Premium Service";		close;		}	case 2:		next;		mes "[Premium Service]";			mes "Very well, I shall be here if you change your mind.";		close;	}OnPCLoginEvent:	if(#VIPSERVICE == 1 && #VIP_Lasttime + $VIP_Cooldown - gettimetick(2) == 0 && getgroupid() == 1) { //Problem	mes "[Premium Service]";	mes "You're premium service duration has gone.";	mes "Please relog again.";	mes "To take effect.";	next;	query_sql "UPDATE `login` SET `group_id` = 0 WHERE `group_id` = 1 AND `account_id` = "+getcharid(3);	set #VIPSERVICE,0;	set #VIP_Lasttime,0;		atcommand "@kick "+strcharinfo(0)+"";	close;	}}

 

  i already underline the problem,i think its the problem why not trigger my script, i dunnow must put that... please help me :)



 

Edited by ahmadshidqi

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Imo change the

#VIP_Lasttime + $VIP_Cooldown - gettimetick(2) == 0

to

(#VIP_Lasttime - gettimetick(2) + $VIP_Cooldown <= 0)

Otherwise you're asking this check to work at the exact second the title should be lift off only.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.