pawn Код:
public CheckGas()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER && !IsPlayerNPC(i))
{
new vehicle = GetPlayerVehicleID(i);
new VehicleModel = GetVehicleModel(vehicle);
if(VehicleModel == 509 || VehicleModel == 481 || VehicleModel == 510)
{
return 1;
}
if(Gas[vehicle] >= 1)
{
if(Gas[vehicle] <= 10) { PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0); }
Gas[vehicle]--;
}
else
{
NoFuel[i] = 1;
TogglePlayerControllable(i, 0);
GameTextForPlayer(i,"r~~n~~n~~n~~n~~n~~n~~n~~n~Sem combustivel~n~ ~b~Chame um mecanido para Re-abastecer ! ",1500,3);
RemovePlayerFromVehicle(i);
SendClientMessage(i, COLOR_YELLOW, "O motor do veнculo apagou por falta de combustнvel, Chame um mecвnico para ajudar.");
}
}
}
}
return 1;
}