27.04.2012, 11:48
Help i made a thingy..but doesent work..if vehicle health is smaller than 300 and then car stops and after the stop i can start engine then engine stops then i statr it..i doesent work..
PHP код:
public CheckCarHealth()
{
new string[128];
new sendername[MAX_PLAYER_NAME];
for (new i=0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new Float:health;
GetVehicleHealth(GetPlayerVehicleID(i),health);
new newcar = GetPlayerVehicleID(i);
if (health <= 300 && !IsModelABoat(newcar) && !IsModelABike(newcar) && !IsModelAPlane(newcar) && !IsASweeper(newcar))
{
if(engineOn[GetPlayerVehicleID(i)] == 1)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
TogglePlayerControllable(i, 0);
SendClientMessage(i, COLOR_GREY, "Motorul sa stricat,poti suna mecanicul!");
engineOn[GetPlayerVehicleID(i)] = false;
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "* Motorul sa stricat! (( %s ))", sendername);
ProxDetector(30.0, i, string, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
}
}
}
}
}