/goto, /get, /getthere
#8

Im sorry for duble post, but i got this:

pawn Код:
CMD:slap(playerid, params[])
{
    new Float:x,Float:y,Float:z;
    if(PVar[playerid][pLevel] >= 1)
    {
        new pID, Msg[128];
        if(sscanf(params, "us[60]", pID)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /slap [PlayerID]");
        if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "ERROR : That user is not connected!");
        if(!IsPlayerConnected(pID) || pID == playerid) return SendClientMessage(playerid, COLOR_RED, "ERROR : Player not connected or its yourself!");
        format(Msg, sizeof(Msg), "** Administrator %s has slapped %s!", pName(playerid), pName(pID));
        SendClientMessageToAll(COLOR_YELLOW, Msg);
        SetPlayerHealth(pID, -20);
        GetPlayerPos(pID,x,y,x);
        SetPlayerPos(pID,x,y,z+6);
        PlayerPlaySound(pID, 1190, x, y, z);
        SendClientMessage(pID, COLOR_RED, "You have been slapped! Behave yourself!");
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR : This command is for admin level 1 only!");
    return true;
}

CMD:slapall(playerid, params[])
{
    new Float:x,Float:y,Float:z;
    new Msg[128];
    if(PVar[playerid][pLevel] >= 3)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                SetPlayerHealth(i, -20);
                GetPlayerPos(i,x,y,x);
                SetPlayerPos(i,x,y,z+6);
                PlayerPlaySound(i, 1190, x, y, z);
                SendClientMessage(i, COLOR_RED, "You have been slapped! Behave yourself!");
            }
        }
        format(Msg, sizeof(Msg), "** Administrator %s has slapped all players!", pName(playerid));
        SendClientMessageToAll(COLOR_GREY, Msg);
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR : This command is for admin level 3 only!");
    return true;
}
All works, but kills all (it should take some health and put the player a little bit up) how to fix it?
Reply


Messages In This Thread
/goto, /get, /getthere - by Markx - 19.03.2011, 09:14
Re: /goto, /get, /getthere - by Biesmen - 19.03.2011, 09:18
Re: /goto, /get, /getthere - by Markx - 19.03.2011, 09:22
Re: /goto, /get, /getthere - by PinkFloydLover - 19.03.2011, 09:24
Re: /goto, /get, /getthere - by [L3th4l] - 19.03.2011, 09:24
Re: /goto, /get, /getthere - by Pooh7 - 19.03.2011, 09:27
Re: /goto, /get, /getthere - by Markx - 19.03.2011, 09:31
Re: /goto, /get, /getthere - by Markx - 19.03.2011, 09:46
Re: /goto, /get, /getthere - by Biesmen - 19.03.2011, 10:25

Forum Jump:


Users browsing this thread: 3 Guest(s)