How can i fix this? - 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: How can i fix this? (
/showthread.php?tid=185421)
How can i fix this? -
BigAl - 24.10.2010
Hello, does anyone know how i can fix this major problem i have, i have a fuel system that i just made. The fuel system does not change fuel and when u enter any vehicle the fuel is always 0. does anyone know?
code:
public OnFilterScriptInit()
{
for(new i=0;i<MAX_VEHICLES;i++) {
fuel[i] = 100;
}
SetTimer("timer_fuel_lower",4200,true);
return 1;
}
thats the bit that is supposed to make the fuel 100 in every car
BigAl
Re: How can i fix this? -
Mauzen - 24.10.2010
We cant say much about it without any code. Could be a problem with integers/floats (you set new a = 0.0 or new Float:a = 0)
Re: How can i fix this? -
BigAl - 24.10.2010
okay i will just go get the code, but the thing is, it works for cars/vehicles scripted into the Gamemode but doesnt work for cars that i spawn, is there anyway i can add this under the callback OnVehicleSpawn(vehicleid)
please reply
Re: How can i fix this? -
Mauzen - 24.10.2010
Yep, you can do it with OnVehicleSpawn:
pawn Код:
public OnVehicleSpawn(vehicleid)
{
fue[vehicleid] = 100;
}