03.08.2014, 19:44
Maybe you should use a timer or OnPlayerUpdate Function to check..
EDIT: and you're doing it incorrectly, you looped inside players, and using i in SetVehicleParamsEx, so that you are using player instead of vehicle. to solve do:
pawn Код:
// Under OnGameModeInit
public OnGameModeInit()
{
SetTimer("EngineBreak", 100, true); // Set a timer for "EngineBreak" function, 100 is fast more than 1 second, true to keep it restarting , not only one time.
return 1;
}
pawn Код:
new veh = GetPlayerVehicleID(i);
If didn't work,
SetVehicleParamEx(veh ,0,lights,alarm,doors,bonnet,boot,objective); // 0 turned off the engine