24.07.2010, 22:15
Topo GM:
Cуdigo:
OnGameModeInit:
Agradeзa
pawn Код:
new engineOn[MAX_PLAYERS];
pawn Код:
forward CheckCarHealth();
public CheckCarHealth()
{
new string[256];
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);
if(health <= 400)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
TogglePlayerControllable(i, 0);
SendClientMessage(i, COLOR_LIGHTBLUE, "Seu veiculo quebrou, tente ligar novamente ou ligue para um mecanico! (/sair para sair do veiculo)");
engineOn[i] = false;
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "* O veiculo de %s quebrou.", sendername);
ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
}
}
}
}
pawn Код:
SetTimer("CheckCarHealth",2000,true);
Agradeзa