Need help: Fuel System Timer - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help: Fuel System Timer (
/showthread.php?tid=70336)
Need help: Fuel System Timer -
Dol - 23.03.2009
Hey I want to set a timer for this command so when there are no admins online it will automaticly refuel every 20 minutes, I already tried it but it failed:
Timer should be set on 20 minutes and can you please add a GameText like this: ''All cars have been refueled''
It's this command:
Код:
}
if(strcmp(cmd, "/fuelcars", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
for(new c=0;c<MAX_VEHICLES;c++)
{
Fuel[c] = GasMax;
}
SendClientMessageToAll(COLOR_ADMINCMD, "INFO: All cars refueled by an administrator.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You are not an administrator.");
return 1;
}
}
return 1;
I hope you can help me!
Re: Need help: Fuel System Timer -
LarzI - 23.03.2009
So you want to check if there are any admins online all time.
Then if there isn't, set a timer of 20 minutes.
And in that timer function, refuel all cars?
Re: Need help: Fuel System Timer -
Dol - 23.03.2009
Yes well I actually would like it to go automaticly even when there is an admin online so we don't have to look at it all the time.
Re: Need help: Fuel System Timer -
MenaceX^ - 23.03.2009
pawn Код:
SetTimer("Refuel",1000*60*20,true);
forward Refuel();
public Refuel()
{
for(new c=0;c<MAX_VEHICLES;c++)
{
Fuel[c] = GasMax;
}
}
Re: Need help: Fuel System Timer -
LarzI - 23.03.2009
Finally someone who does x*x*x instead of just a large number of ms
Re: Need help: Fuel System Timer -
Dol - 23.03.2009
Thanks MenaceX now I see I only did one thing wrong!
Re: Need help: Fuel System Timer -
LarzI - 23.03.2009
pawn Код:
public Refuel()
{
for(new c=0;c<MAX_VEHICLES;c++)
{
Fuel[c] = GasMax;
}
return GameTextForAll("All cars ~g~refueled", 5000, 4);
}
Re: Need help: Fuel System Timer -
Dol - 23.03.2009
Thanks!
Is that on the top or on the bottom? I want it on the top.
Re: Need help: Fuel System Timer -
LarzI - 23.03.2009
It's over your head