26.06.2012, 18:28
There is a bug if the player didn't rented the car he can still start up the engine
Код:
if(strcmp(cmd, "/engine", true) == 0 || strcmp(cmd, "/e", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsPlayerInAnyVehicle(playerid)) { if(IsADmv(idcar) || IsAHarvest(idcar) || IsADrugHarvest(idcar) || IsAPlane(idcar) || IsASweeper(idcar) || pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1; if(Gas[idcar] == 0) return SendClientMessage(playerid,COLOR_GREY," No fuel in this vehicle! Call a Mechanic (555)!"); if(dying[playerid] == 1) return SendClientMessage(playerid,COLOR_GREY," Do not Bug Abuse!"); if(!engineOn[idcar]) { if(GetPlayerState(playerid) != PLAYER_STATE_PASSENGER) { new playerveh = GetPlayerVehicleID(playerid); engineOn[idcar] = true; PutPlayerInVehicle(playerid, playerveh, 0); TogglePlayerControllable(playerid,1); SendClientMessage(playerid, FFB900, "[VehicleControl] The car's engine is {FF0700}on now!"); format(string, sizeof(string), "%s spins the key and starts vehicle engine.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return 1; } return 1; } else if(engineOn[idcar]) { if(GetPlayerState(playerid) != PLAYER_STATE_PASSENGER) { engineOn[idcar] = false; TogglePlayerControllable(playerid, 0); SendClientMessage(playerid, FFB900, "[VehicleControl] The car's engine is {FF0700}off now!"); format(string, sizeof(string), "%s spins the key and turns off the engine.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return 1; } return 1; } } } return 1; }