03.08.2014, 19:34
Using this system https://sampforum.blast.hk/showthread.php?tid=152774
I want to do when the car has 300 hp car engine to stop, do not want him out of the car or give him freeze.
What I've tried so far:
Sorry for my english
I want to do when the car has 300 hp car engine to stop, do not want him out of the car or give him freeze.
What I've tried so far:
pawn Код:
forward EngineBreak();
public EngineBreak()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new Float:TempCarHealth;
GetVehicleHealth(GetPlayerVehicleID(i), TempCarHealth);
if(TempCarHealth <= 300.0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == 1)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
//SetVehicleHealth(GetPlayerVehicleID(i), 350.0);
SendClientMessage(i, COLOR_RED, "The vehicle`s engine was broken. Call a mechanic");
//RemovePlayerFromVehicle(i);
TogglePlayerControllable(i, 0);
}
}
}
}
}
}
