Fuel Problem - 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: Fuel Problem (
/showthread.php?tid=494765)
Fuel Problem -
Teemo - 14.02.2014
pawn Код:
for(new i=0;i<MAX_PLAYERS;i++) {
if (isrefuelling[i]) continue;
new vid = GetPlayerVehicleID(i);
if (GetPlayerVehicleSeat(i) == 0) {
fuel[vid] = fuel[vid] - 2;
if (fuel[vid]<1)
{
fuel[vid] = 0;
//RemovePlayerFromVehicle(i);
GameTextForPlayer(i,"~r~Out of ~w~fuel~r~!",5000,4);
}
}
new string[128];format(string,sizeof string,"Fuel: %i",fuel[vid] /4);
TextDrawSetString(td_fuel[i],string);
I want the fuel decrease every 10 seconds at least, How to do that?
Re: Fuel Problem -
Teemo - 14.02.2014
A help?
Re: Fuel Problem -
Aerotactics - 14.02.2014
Quote:
Originally Posted by Teemo
A help?
|
Captain Teemo on Duty! Oh, sorry.
Off-topic:
http://*********/U996nO8zkZs
I just saw your name and thought it was a coincidence, until I saw your pic.
Re: Fuel Problem -
Teemo - 14.02.2014
lol...Nice video and thanks but i hope you help me with that bug.
Re: Fuel Problem -
CuervO - 14.02.2014
You'd need a timer that runs every 10 seconds, and by the looks of your function, it'd be a global timer.
https://sampwiki.blast.hk/wiki/SetTimer
Re: Fuel Problem -
Teemo - 14.02.2014
Well you're right! but if i made a timer, it will effect on the speedometer, Because they are together and the speedometer will show me the last speed which i was on every 10 seconds...I am right?
Re: Fuel Problem -
CuervO - 14.02.2014
yep, you can separate them though
Re: Fuel Problem -
Teemo - 14.02.2014
Great idea, Thank you for trying to help