Waiting Time - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Waiting Time (
/showthread.php?tid=505742)
Waiting Time -
AphexCCFC - 10.04.2014
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.
Re: Waiting Time -
Twizted - 10.04.2014
http://forum.sa-mp.com/showpost.php?...29&postcount=2
Have a look here, Aphex. If you understand nothing, reply back here.
Re: Waiting Time -
AphexCCFC - 10.04.2014
Understandable, but how can I make it so if someone types /sweep it tells them how long left they have to wait?
Re: Waiting Time -
Danijel. - 10.04.2014
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
Re: Waiting Time -
AphexCCFC - 10.04.2014
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?
Re: Waiting Time -
Danijel. - 10.04.2014
you dont need loads of timers, you can put all the jobs in one

, beacuse this timer doesnt depend on players working