/want /unwarn
#1

[DELETED]
Reply
#2

pawn Code:
CMD:warn(playerid, params[])
{
        levelerror(2);
        if (sscanf(params, "us[200]", plid, estring))
        return SendErrorMessage(playerid, "Usage: /warn <id> <reason>");

        if (!IsPlayerConnected(plid))
        return SendErrorMessage(playerid, "Player Not Connected!");

        SetPVarInt(plid, "Warns", GetPVarInt(plid, "Warns") + 1);
    format(string, sizeof string, "You have warned {FFFFFF}%s(%d)", PlayerName(plid), plid);
        SendClientMessage(playerid, 0x66FF33, string);
        if(GetPVarInt(plid, "Warns") >= 3)
        {
        format(largestring, sizeof largestring, "Admin %s warned you (%i warns) Reason:%s", PlayerName(playerid), GetPVarInt(plid, "Warns"), estring);
        SendClientMessage(playerid, -1, largestring);
        SendClientMessage(plid, -1, "You've been banned for 3 warnings.");
            BanEx(plid, "3 warnings");
        return 1;
    }
        format(largestring, sizeof largestring, "Admin %s warned you \r\nReason:%s\r\nWarns: %i", PlayerName(playerid), estring, GetPVarInt(plid, "Warns"));
        ShowPlayerDialog(plid, DIALOG_KICK, DIALOG_STYLE_MSGBOX, "You have been warned. Warns: ", largestring, "Ok", "Cancel");
        return 1;
}

CMD:unwarn(playerid, params[])
{
        levelerror(4);
        if (sscanf(params, "us", plid))
        return SendErrorMessage(playerid, "Usage: /unwarn <id>");

        if (!IsPlayerConnected(plid))
        return SendErrorMessage(playerid, "Player Not Connected!");

    if(GetPVarInt(plid, "Warns") < 1)
        return SendClientMessage(playerid, -1, "Selected player has no warnings.");

        SetPVarInt(plid, "Warns", GetPVarInt(plid, "Warns") - 1);
    format(string, sizeof string, "You unwarned {FFFFFF}%s(%d)", PlayerName(plid), plid);
        SendClientMessage(playerid, 0x66FF33, string);
        format(string, sizeof string, "Admin %s unwarned you.", PlayerName(playerid));
    SendClientMessage(plid, -1, string);
        return 1;
}
Reply
#3

[DELETED]
Reply
#4

Yes, all you need, is to add that code and change the reason to '3 warns'.

Of course, you might want to delete the 'BanEx(playerid, "3 warns")' line.
Reply
#5

[DELETED]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)