28.11.2011, 12:42
Bro. With this line:
for(new i=0;i<MAX_VEHICLES;i++)
You're telling the script to read from vehicles, not players.
Where here:
SetVehicleParamsEx(i, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
You're also telling the script to read from vehicles, not players.
The reason being is because i, in this code, stands for max_vehicles, not for max_players.
So you need to probably do this:
for(new i=0;i<MAX_VEHICLES;i++)
You're telling the script to read from vehicles, not players.
Where here:
SetVehicleParamsEx(i, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
You're also telling the script to read from vehicles, not players.
The reason being is because i, in this code, stands for max_vehicles, not for max_players.
So you need to probably do this:
Код:
#include <a_samp> forward FuelConsumption(); public FuelConsumption() { for(new i=0;i<MAX_VEHICLES;i++) { VehicleGas -= 1; if(VehicleGas[i] == 0) { for(new playerid; playerid < MAX_PLAYERS; playerid++) { SetVehicleParamsEx(playerid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective); } } } return 1; // Not really sure if yours is a timer or what, don't return this value if you don't need to in your code. }