16.12.2016, 15:43
Hello people!
I have a .... As the title says, It has an warning which called "Unreachable code." I want to fix that warning and so there is the code...![Smiley](images/smilies/smile.png)
So, and the warning (Also the line) are below.
The Lines.
Please, by reading them carefully, i will be thankful if you could help me a little bit!
I have a .... As the title says, It has an warning which called "Unreachable code." I want to fix that warning and so there is the code...
![Smiley](images/smilies/smile.png)
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { //------------------------------------------------------------------------------ passenger[playerid] = ispassenger; if (GetPlayerSurfingVehicleID(playerid) == vehicleid) { ClearAnimations(playerid); } if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 592 && ispassenger == 1) { SetPlayerInterior(playerid,9); SetPlayerFacingAngle(playerid,0.0); SetPlayerPos(playerid, 315.856170,1024.496459,1949.797363); SetCameraBehindPlayer(playerid); InAndrom[playerid]=vehicleid; } if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 519 && ispassenger) { if (!ShamalExists(vehicleid)) { CreateShamalInt(vehicleid, float(randomEx(3000)), float(randomEx(3000)), float(random(100)+800)); } SetPlayerPosInShamal(playerid, vehicleid); InShamal[playerid] = vehicleid; } #if defined ENABLE_SPEC for(new xp=0; xp<MAX_PLAYERS; xp++) { if(GetPlayerState(xp) == PLAYER_STATE_SPECTATING && PlayerInfo[xp][SpecID] == playerid) { TogglePlayerSpectating(xp, 1); PlayerSpectateVehicle(xp, vehicleid); PlayerInfo[xp][SpecType] = ADMIN_SPEC_TYPE_VEHICLE; } } #endif if(onsys[vehicleid] == 1) { if(passenger[playerid] == 0) { if(PlayerInfo[playerid][LoggedIn] == 1) { if (strcmp(VehicleInfo[vehicleid][owner],PlayerInfo[playerid][name],false) == 0) { new string[128]; format(string, sizeof(string), "~n~~n~~n~~g~Welcome to your %s %s, please drive carefully!", VehicleInfo[vehicleid][name], PlayerInfo[playerid][name]); GameTextForPlayer(playerid, string, 3000, 4); format(string, sizeof(string), "Welcome to your %s %s, please drive carefully!", VehicleInfo[vehicleid][name], PlayerInfo[playerid][name]); SendClientMessage(playerid, green, string); return 1; } if (strcmp(VehicleInfo[vehicleid][owner],DEFAULT_OWNER,false) == 0) { if(VehicleInfo[vehicleid][buybar] == 1) { new string[128]; format(string,sizeof(string),"~n~~n~~n~~r~This %s has been set as non-buyable by server administration!", VehicleInfo[vehicleid][name]); GameTextForPlayer(playerid, string, 3000, 4); format(string,sizeof(string),"This %s has been set as non-buyable by server administration!", VehicleInfo[vehicleid][name]); SendClientMessage(playerid, red, string); return 1; } new string[128]; format(string, sizeof(string), "~n~~n~~n~~y~This %s is for sale and costs $%d, type /vmenu to see vehicle options.",VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][vehiclecost]); GameTextForPlayer(playerid, string, 3000, 4); format(string, sizeof(string), "This %s is for sale and costs $%d, type /vmenu to see vehicle options.",VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][vehiclecost]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } else { new string[128]; format(string, sizeof(string), "~n~~n~~n~~r~This %s belongs to %s, and cannot be purchased.", VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][owner]); GameTextForPlayer(playerid, string, 3000, 4); format(string, sizeof(string), "This %s belongs to %s, and cannot be purchased.", VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][owner]); SendClientMessage(playerid, red, string); return 1; } } else { new playername[128]; GetPlayerName(playerid,playername,sizeof(playername)); if (strcmp(VehicleInfo[vehicleid][owner],playername,false) == 0) { new string[128]; format(string, sizeof(string), "Welcome to your %s %s, please drive carefully! ~n~Remember, you must be logged in to access vehicle controls.", VehicleInfo[vehicleid][name], playername); return GameTextForPlayer(playerid, string, 3000, 4); format(string, sizeof(string), "Welcome to your %s %s, please drive carefully! Remember, you must be logged in to access vehicle controls.", VehicleInfo[vehicleid][name], playername); SendClientMessage(playerid, green, string); } if (strcmp(VehicleInfo[vehicleid][owner],DEFAULT_OWNER,false) == 0) { if(VehicleInfo[vehicleid][buybar] == 1) { new string[128]; format(string,sizeof(string),"~n~~n~~n~~r~This %s has been set as non-buyable by server administration!", VehicleInfo[vehicleid][name]); return GameTextForPlayer(playerid, string, 3000, 4); format(string,sizeof(string),"This %s has been set as non-buyable by server administration!", VehicleInfo[vehicleid][name]); SendClientMessage(playerid, red, string); } new string[128]; format(string, sizeof(string), "~n~~n~~n~~y~This %s is for sale and costs $%d, ~n~You must be logged in to purchase a vehicle.",VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][vehiclecost]); return GameTextForPlayer(playerid, string, 3000, 4); format(string, sizeof(string), "This %s is for sale and costs $%d, You must be logged in to purchase a vehicle.",VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][vehiclecost]); SendClientMessage(playerid, yellow, string); } else { new string[128]; format(string, sizeof(string), "~n~~n~~n~~r~This %s belongs to %s, and cannot be purchased.", VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][owner]); return GameTextForPlayer(playerid, string, 3000, 4); format(string, sizeof(string), "This %s belongs to %s, and cannot be purchased.", VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][owner]); SendClientMessage(playerid, red, string); } } } } return 1; }
Код:
C:\Users\ўггелпт\Desktop\НЭпт цЬкелпт\Gamemodes\NFTDM.pwn(25790) : warning 225: unreachable code C:\Users\ўггелпт\Desktop\НЭпт цЬкелпт\Gamemodes\NFTDM.pwn(25798) : warning 225: unreachable code C:\Users\ўггелпт\Desktop\НЭпт цЬкелпт\Gamemodes\NFTDM.pwn(25804) : warning 225: unreachable code C:\Users\ўггелпт\Desktop\НЭпт цЬкелпт\Gamemodes\NFTDM.pwn(25811) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Warnings.
Код:
25790 LINE: format(string, sizeof(string), "Welcome to your %s %s, please drive carefully! Remember, you must be logged in to access vehicle controls.", VehicleInfo[vehicleid][name], playername); 25798 LINE: format(string,sizeof(string),"This %s has been set as non-buyable by server administration!", VehicleInfo[vehicleid][name]); 25804 LINE: format(string, sizeof(string), "This %s is for sale and costs $%d, You must be logged in to purchase a vehicle.",VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][vehiclecost]); AND THE 25811 LINE: format(string, sizeof(string), "This %s belongs to %s, and cannot be purchased.", VehicleInfo[vehicleid][name], VehicleInfo[vehicleid][owner]);
![Cheesy](images/smilies/biggrin.png)