11.06.2013, 11:09
This is the exact same code:
Do you see it now?
Your code will always do the return statement in the middle, which means the code below can never be reached (hence "unreachable").
So please, please, just INDENT YOUR CODE AND USE BRACES.
pawn Код:
CMD:handsup(playerid, params[])
{
if (GetPlayerState(playerid) != 1 && GetPlayerState(playerid) != 2 && GetPlayerState(playerid) != 3 && GetPlayerState(playerid) != 7)
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return SendClientMessage(playerid, COLOR_RED, "[Error]: You cannot use animations while in the vehicle!");
}
}
return SendClientMessage(playerid, COLOR_RED, "[Spawned]: You must be spawned, To use this command!");
if (pInfo[playerid][Freeze] == 1)
{
return SendClientMessage(playerid, COLOR_RED, "[Error]: You are frozen, Cannot use this command!");
}
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
SendAdminCMD(playerid, "handsup");
return 1;
}
Your code will always do the return statement in the middle, which means the code below can never be reached (hence "unreachable").
So please, please, just INDENT YOUR CODE AND USE BRACES.