26.10.2012, 15:32
Код:
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 true; } if(Gas[vehicle] >= 1) { if(Gas[vehicle] <= 10) { PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0); } Gas[vehicle]--; } else { NoFuel[i] = 1; Controle(i, 0); PlayerPlaySound(i, 1159, 0.0, 0.0, 0.0); GameTextForPlayer(i,"Sem combustivel~n~Use /sair Para sair do veiculo",1500,3); SendClientMessage(i, COLOR_YELLOW, "O motor do veнculo apagou por falta de combustнvel, Chame um mecвnico para ajudar."); } } } } return true; }