19.09.2011, 17:40
Hey all.
I have an Role Play server, won't go further into details and It has a bug with "/engine" command.
I can start it, then stop it, and when i have Stopped it once, i get this message: "NAME - spins a key and turns off the engine." And when i try "/engine" again, i get same comment, and i'm stuck, how can i fix this? the code is below:
It compiles with no errors.
I have an Role Play server, won't go further into details and It has a bug with "/engine" command.
I can start it, then stop it, and when i have Stopped it once, i get this message: "NAME - spins a key and turns off the engine." And when i try "/engine" again, i get same comment, and i'm stuck, how can i fix this? the code is below:
Quote:
if(!strcmp(cmd, "/engine", true)) { if(IsPlayerConnected(playerid)) { if(IsPlayerInAnyVehicle(playerid)) { if(!engineOn[GetPlayerVehicleID(playerid)]) { if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1; if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1; if(IsARentableCar(idcar)) { if(HireCar[playerid] != idcar) return 1; } if(IsAHarvest(idcar)) return 1; if(IsADrugHarvest(idcar)) return 1; if(IsASweeper(idcar)) return 1; if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999) return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!"); format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); SetTimerEx("StartingTheVehicle",3500,0,"i",playeri d); gEngine[playerid] = 1; new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername); CommandLog(string); return 1; } else if(engineOn[GetPlayerVehicleID(playerid)]) { if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1; if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1; if(IsARentableCar(idcar)) { if(HireCar[playerid] != idcar) return 1; } if(IsAHarvest(idcar)) return 1; if(IsADrugHarvest(idcar)) return 1; if(IsASweeper(idcar)) return 1; if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999) return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!"); format(string, sizeof(string), "* %s spins a key and turns off the engine.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); SafeRemovePlayerFromVehicle(playerid); TextDrawHideForPlayer(playerid, Textdraw39[playerid]); TextDrawHideForPlayer(playerid, Textdraw40[playerid]); TextDrawHideForPlayer(playerid, Textdraw53[playerid]); gEngine[playerid] = 0; TogglePlayerControllable(playerid, 0); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername); CommandLog(string); return 1; } } } return 1; } |