SA-MP Forums Archive
Link a value to a vehicle? - 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: Link a value to a vehicle? (/showthread.php?tid=511058)



Link a value to a vehicle? - arjanforgames - 03.05.2014

How could I link a value, for example fuel, to a vehicle? That way so its dynamic for every vehicle.


Re: Link a value to a vehicle? - XK - 03.05.2014

you could create for cars and when you write the command like /vehiclefuel[vehicleid][fuel] it sets the fuel to the amount you wrote like
pawn Код:
new VehicleGas[MAX_VEHICLES];
and use ZCMD to make the command or.. and when he writes it :
pawn Код:
VehicleGas[vehicleid] = fuel; //use ZCMD or..to define vehicleid as the first parameter and the fuel as the second paameter.



Re: Link a value to a vehicle? - arjanforgames - 03.05.2014

Ah thanks, I totally forgot about MAX_VEHICLES