Jump to content
  • 0

Hourly Vending Not Stop ?


Bringer

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  748
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

Spoiler

-	script	hourlypoints	-1,{
//--Start of the Script
OnPCLoginEvent:
	addtimer .timer,"hourlypoints::OnPointGet";
	set @hourly_points_timer, gettimetick(2) + ( .timer / 1000 );
	attachnpctimer ""+strcharinfo(0)+"";
	initnpctimer;
	dispbottom "Hourly Rewards have been started for this character.";
	end;

OnPointGet:
	OnTimer30000:
	if(checkVending()== 1) {
		dispbottom "The hourly points event haulted because you were vending.";
    		stopnpctimer;
		end;
		}
	set #hourlypoints, #hourlypoints + .point_amt;
	dispbottom "You received "+.point_amt+" Reward Hourly Points by staying ingame for 1 hour";
	dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
	set @consecutive_hour, @consecutive_hour + 1;

	//Check for 2 hours consecutive
	if(@consecutive_hour == 2) {
		set #HourlyPoints, #HourlyPoints + .2cpoint_amt;
		dispbottom "You received "+.2cpoint_amt+" Reward Hourly Points due to playing for 2 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 3 hours consecutive
	else if(@consecutive_hour == 3) {
		set #HourlyPoints, #HourlyPoints + .3cpoint_amt;
		dispbottom "You received "+.3cpoint_amt+" Reward Hourly Points due to playing for 3 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 4 hours consecutive
	else if(@consecutive_hour == 4) {
		set #HourlyPoints, #HourlyPoints + .4cpoint_amt;
		dispbottom "You received "+.4cpoint_amt+" Reward Hourly Points due to playing for 4 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 5 hours consecutive
	else if(@consecutive_hour == 5) {
		set #HourlyPoints, #HourlyPoints + .5cpoint_amt;
		dispbottom "You received "+.5cpoint_amt+" Reward Hourly Points due to playing for 5 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 6 hours consecutive
	else if(@consecutive_hour == 6) {
		set #HourlyPoints, #HourlyPoints + .6cpoint_amt;
		dispbottom "You received "+.6cpoint_amt+" Reward Hourly Points due to playing for 6 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 7 hours consecutive
	else if(@consecutive_hour == 7) {
		set #HourlyPoints, #HourlyPoints + .7cpoint_amt;
		dispbottom "You received "+.7cpoint_amt+" Reward Hourly Points due to playing for 7 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 8 hours consecutive
	else if(@consecutive_hour == 8) {
		set @consecutive_hour,0;
		set #HourlyPoints, #HourlyPoints + .8cpoint_amt;
		dispbottom "You received "+.8cpoint_amt+" Reward Hourly Points due to playing for 8 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
	}
	addtimer .timer,"hourlypoints::OnPointGet";
	end;

OnCmdHour:
	mes "^0033ff[ War Server ]^000000";
	mes "Total Hours Online " +@consecutive_hour+ "";
	mes "Reward Hourly Points : ^FF0000[ "+#HourlyPoints+" ]^000000";
	mes " ";
	message strcharinfo(0),@hourly_points_timer ? Time2Str( @hourly_points_timer )+" Remaining.":"Something went wrong relog!";
	end;

OnInit:
    bindatcmd "reward","hourlypoints::OnCmdHour";
    set .timer, 1000*60*60; //Timer in milliseconds.
    set .2cpoint_amt, 20; //Points gained for consecutive time online.
    set .3cpoint_amt, 30; //Points gained for consecutive time online.
    set .4cpoint_amt, 40; //Points gained for consecutive time online.
    set .5cpoint_amt, 50; //Points gained for consecutive time online.
    set .6cpoint_amt, 60; //Points gained for consecutive time online.
    set .7cpoint_amt, 70; //Points gained for consecutive time online.
    set .8cpoint_amt, 80; //Points gained for consecutive time online.    
    set .point_amt, 10; //Normal points gained.
}

 

even arleady vending the timer will not stop

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  1138
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

add this 

OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1) {
    dispbottom "The hourly  rewards has stopped because you were vending . Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
 

 

Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  1138
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

5 minutes ago, Bringer said:

OnPointGet: OnTimer30000: if(checkVending()== 1) { dispbottom "The hourly points event haulted because you were vending."; stopnpctimer; end; } but still the hourly timer not stop

 

if(checkvending() >= 1) {
    dispbottom "The hourly  rewards has stopped because you were vending . Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
 

try adding this

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  748
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

22 minutes ago, Cyro said:

 


OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1) {
    dispbottom "The hourly  rewards has stopped because you were vending . Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
 

 

OnPointGet: OnTimer30000: if(checkVending()== 1) { dispbottom "The hourly points event haulted because you were vending."; stopnpctimer; end; } but still the hourly timer not stop

 

Edited by Bringer
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...