[HELP]Unreachable Code?
#2

pawn Код:
dcmd_slap(playerid,params[])
{
    if(IsPlayerCommandLevel(playerid,"slap"))
    {
        if(!strlen(params)) return SendClientMessage(playerid,red,"Usage: /slap [playerid] [reason]");
        new tmp[256],Index; tmp = strtok(params,Index);
        new id; if(!IsNumeric(tmp)) id = ReturnPlayerID(tmp); else id = strval(tmp);
        if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid)
        {
                new string[256],name[24],ActionName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24);
                if(!strlen(params[strlen(tmp)+1]))
                    format(string,256,"[INFO]: %s [ID:%d] has been slapped by %s [ID:%d] for: No Reason Given",ActionName,id,name,playerid);
                else
                    format(string,256,"[INFO]: %s [ID:%d] has been slapped by %s [ID:%d] for: %s)",ActionName,id,name,playerid,params[strlen(tmp)+1]);
                SendClientMessageToAll(yellow,string);
               
                new Float:x, Float:y, Float:z;GetPlayerPos(id, x,y,z); //Line 374
                return SetPlayerPos(id, x,y,z+5);
               
        }
        else
            return SendClientMessage(playerid,red,"ERROR: You cannot slap yourself or a disconnected player.");
    }
    else
        return SendLevelErrorMessage(playerid,"slap");
}
Should work.
Reply


Messages In This Thread
[HELP]Unreachable Code? - by Tigerbeast11 - 04.08.2011, 14:05
Re: [HELP]Unreachable Code? - by RyDeR` - 04.08.2011, 14:10
AW: [HELP]Unreachable Code? - by Drebin - 04.08.2011, 14:11
Re: [HELP]Unreachable Code? - by Tigerbeast11 - 04.08.2011, 14:13
Re: [HELP]Unreachable Code? - by RyDeR` - 04.08.2011, 14:15
Re: [HELP]Unreachable Code? - by Tigerbeast11 - 04.08.2011, 14:16

Forum Jump:


Users browsing this thread: 1 Guest(s)