/warn + slap [HELP]
#1

Greetings,

I have this command for admin. /Warn command, it works fine but I want to add into this a /slap. I mean when some one warn anyone it gets slaped.

pawn Код:
dcmd_warn(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 1)
    {
        new Index;
        new tmp[256];  tmp  = strtok(params,Index);
        new tmp2[256]; tmp2 = strtok(params,Index);
       
        if(!strlen(tmp) || !strlen(tmp2)) return
        SendClientMessage(playerid, grey, "USAGE: /warn [PlayerID] [Reason]") &&
        SendClientMessage(playerid, orange, "ATENTION: Function will give a warning in specified player");
        new warned = strval(tmp);
        new str[128];
        if(AccInfo[warned][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
        return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(warned) && warned != INVALID_PLAYER_ID)
         {
            if(warned != playerid)
             {
                SendCommandToAdmins(playerid,"Warn");
                AccInfo[warned][Warnings]++;
                if( AccInfo[warned][Warnings] == MAX_WARNINGS)
                {
                format(str, sizeof (str), "Administrator \"%s\" has kicked \"%s\". Reason: %s (Warnings: %d/%d)", pName(playerid), pName(warned), params[1+strlen(tmp)], AccInfo[warned][Warnings], MAX_WARNINGS);
                SendClientMessageToAll(lightred, str);
                SaveIn("KickLog",str);
                Kick(warned);
                return AccInfo[warned][Warnings] = 0;
                }
                else
                {
                format(str, sizeof (str), "Administrator \"%s\" has given \"%s\" a warning. Reason: %s (Warnings: %d/%d)", pName(playerid), pName(warned), params[1+strlen(tmp)], AccInfo[warned][Warnings], MAX_WARNINGS);
                return SendClientMessageToAll(yellow, str);
                }
            }
            else return SendClientMessage(playerid, red, "ERROR: You cannot warn yourself");
        }
        else return ErrorMessages(playerid, 2);
    }
    else return ErrorMessages(playerid, 1);
}
Thanks for reading and for your help.
Reply
#2

pawn Код:
dcmd_warn(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 1)
    {
        new Index;
        new tmp[256];  tmp  = strtok(params,Index);
        new tmp2[256]; tmp2 = strtok(params,Index);
       
        if(!strlen(tmp) || !strlen(tmp2)) return
        SendClientMessage(playerid, grey, "USAGE: /warn [PlayerID] [Reason]") &&
        SendClientMessage(playerid, orange, "ATENTION: Function will give a warning in specified player");
        new warned = strval(tmp);
        new str[128];
        if(AccInfo[warned][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
        return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(warned) && warned != INVALID_PLAYER_ID)
         {
            if(warned != playerid)
             {
                SendCommandToAdmins(playerid,"Warn");
                AccInfo[warned][Warnings]++;
                if( AccInfo[warned][Warnings] == MAX_WARNINGS)
                {
                format(str, sizeof (str), "Administrator \"%s\" has kicked \"%s\". Reason: %s (Warnings: %d/%d)", pName(playerid), pName(warned), params[1+strlen(tmp)], AccInfo[warned][Warnings], MAX_WARNINGS);
                SendClientMessageToAll(lightred, str);
                SaveIn("KickLog",str);
                Kick(warned);
                return AccInfo[warned][Warnings] = 0;
                }
                else
                {
                format(str, sizeof (str), "Administrator \"%s\" has given \"%s\" a warning. Reason: %s (Warnings: %d/%d)", pName(playerid), pName(warned), params[1+strlen(tmp)], AccInfo[warned][Warnings], MAX_WARNINGS);
                new Float:Pos[3];
                GetPlayerPos(playerb, Pos[0], Pos[1], Pos[2]);
                SetPlayerPos(playerb, Pos[0], Pos[1], Pos[2]+5);
                }
                return SendClientMessageToAll(yellow, str);
            }
            else return SendClientMessage(playerid, red, "ERROR: You cannot warn yourself");
        }
        else return ErrorMessages(playerid, 2);
    }
    else return ErrorMessages(playerid, 1);
}
This would only throw the player in to the air though
Reply
#3

I can`t see where you editd something
Reply
#4

pawn Код:
new Float:Pos[3];
                GetPlayerPos(playerb, Pos[0], Pos[1], Pos[2]);
                SetPlayerPos(playerb, Pos[0], Pos[1], Pos[2]+5);
Reply
#5

Yeah. I see. Iґll check it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)