Waiting Time
#1

How do I go about setting a 60 minute timer after completing a sweeping route, and when they try and sweep again it shows the time left in minutes (only when the player is connected)?

I have
pawn Код:
PlayerInfo[playerid][pSideJob]
where I can save the minutes but not sure how to take off a minute everytime it passes.
Reply
#2

http://forum.sa-mp.com/showpost.php?...29&postcount=2

Have a look here, Aphex. If you understand nothing, reply back here.
Reply
#3

Understandable, but how can I make it so if someone types /sweep it tells them how long left they have to wait?
Reply
#4

put a timer on ongamemodeinit
Код:
SetTimer("SideJob", 60000, true);
it should go every minute and lower the player variable by one, when it reaches 0 you can work again
Код:
forward SideJob();
public SideJob();
{
foreach(Player, i)
{
if(PlayerInfo[i][SideJob] >0)
{
PlayerInfo[i][SideJob]--;
if(PlayerInfo[i][SideJob] == 0)
{
SendClientMessage(i, -1, "You can work again");
}
}
}
return 1;
}
It should look something like this.
And when you finish work it puts the variable back at 60 or how many minutes you want
Reply
#5

True, true. Looks like it should work I'll check it out later. Say loads of timers for side jobs activate for loads of players, will that cause extreme lag?
Reply
#6

you dont need loads of timers, you can put all the jobs in one , beacuse this timer doesnt depend on players working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)