17.05.2012, 12:42
Quote:
"unreachable code" error occurs when you put an "return" before the end of the function, you have not pasted ALL your OnPlayerCommandText, but you can fix it by yourself just checking for all "returns" in to your code and seeing if it is outside of an condition.
|
pawn Код:
if(strcmp(cmd,"/portable",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
{
if(ConnectedToPC[playerid] == 255)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "{FFFFFF}[{4FD359}Hard2Games{FFFFFF}]: Ai deconectat Laptop-ul.");
ConnectedToPC[playerid] = 0;
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "{FFFFFF}[{4FD359}Hard2Games{FFFFFF}]: Laptop-ul este Pornit.");
SendClientMessage(playerid, COLOR_GREEN, "{FFFFFF}|------|{FF0000} Hitman Agency {FFFFFF}|------|{FF0000}");
SendClientMessage(playerid, COLOR_YELLOW2, "");
SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} News");
SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} Contracts");
SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} Givehit");
SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} Ranks");
SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} Logout");
SendClientMessage(playerid, COLOR_GREEN, "{FFFFFF}|------|{FF0000} Hitman Agency {FFFFFF}|------|{FF0000}");
ConnectedToPC[playerid] = 255;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "{FFFFFF}[{4FD359}Hard2Games{FFFFFF}]: Ne pare rau, dar nu faci parte din factiunea Hitman Agency.");
}
}
return 1;
}
pawn Код:
55006: if(strcmp(cmd,"/portable",true)==0)