I need a warn cmd
#2

pawn Код:
if(strcmp(cmd, "/warn", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, YOURCOLOR, "USAGE: /warn [playerid/PartOfName] [reason]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[64];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, YOURCOLOR, "USAGE: /warn [playerid/PartOfName] [reason]");
                            return 1;
                        }
                        new year, month,day;
                        getdate(year, month, day);
                        format(string, sizeof(string), "You warned %s, reason: %s", giveplayer, (result));
                        SendClientMessage(playerid, COLOR_YOURCOLOR, string);
                        format(string, sizeof(string), "You were warned by %s, reason: %s", sendername, (result));
                        SendClientMessage(giveplayerid, COLOR_YOURCOLOR, string);
                        format(string, sizeof(string), "AdmCmd: %s was warned by %s, reason: %s", giveplayer, sendername, (result));
                        SendClientMessageToAll(0xE42217FF, string);
                        format(string, sizeof(string), "AdmCmd: %s was warned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
                        return 1;
                    }
                }//not connected
            }
            else
            {
                format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
                SendClientMessage(playerid, YOURCOLOR, string);
            }
        }
        return 1;
    }
And change YOURCOLOR to the colors you want.
Reply


Messages In This Thread
I need a warn cmd - by dillo1000 - 10.08.2011, 13:52
Re: I need a warn cmd - by Jafet_Macario - 10.08.2011, 13:57
Re: I need a warn cmd - by dillo1000 - 10.08.2011, 14:00
Re: I need a warn cmd - by dillo1000 - 10.08.2011, 14:03
Re: I need a warn cmd - by Riddick94 - 10.08.2011, 14:03
Re: I need a warn cmd - by Jafet_Macario - 10.08.2011, 14:06
Re: I need a warn cmd - by dillo1000 - 10.08.2011, 14:06
Re: I need a warn cmd - by Riddick94 - 10.08.2011, 14:08
Re: I need a warn cmd - by dillo1000 - 10.08.2011, 14:13
Re: I need a warn cmd - by MadeMan - 10.08.2011, 14:15
Re: I need a warn cmd - by Jafet_Macario - 10.08.2011, 14:18
Re: I need a warn cmd - by dillo1000 - 10.08.2011, 14:19
Re: I need a warn cmd - by dillo1000 - 10.08.2011, 14:23
Re: I need a warn cmd - by Jafet_Macario - 10.08.2011, 14:29
Re: I need a warn cmd - by dillo1000 - 10.08.2011, 14:32
Re: I need a warn cmd - by dillo1000 - 10.08.2011, 14:36
Re: I need a warn cmd - by Jafet_Macario - 10.08.2011, 14:43
Re: I need a warn cmd - by dillo1000 - 10.08.2011, 14:44
Re: I need a warn cmd - by Jafet_Macario - 10.08.2011, 14:58
Re: I need a warn cmd - by Riddick94 - 10.08.2011, 15:01

Forum Jump:


Users browsing this thread: 7 Guest(s)