/warn request
#1

I know of a simple /warn command, but how about this
like....

WarnID(1) belongs to Player_1 because of: Aimbot
WarnID(2) belongs to Player_2 because of: Abuse
WarnID(3) belongs to Player_1 because of: Ram
WarnID(4) belongs to Player_3 because of: RCON attempt login

like...every warnID corresponds to one player...I dont know how
HELP
Reply
#2

This should work, tell me if anything went wrong.
pawn Код:
// Add this to the top
new TimesWarned[MAX_PLAYERS];

// Add this under OnPlayerDisconnect
TimesWarned[playerid] = 0;

/* This is the command - zcmd and sscanf
   Add your admin stuff */

CMD:warn(playerid, params[])
{
    new id, reason[64], string[144] p_name[24];
    if(sscanf(params, "us[64]", id, reason))
        return SendClientMessage(playerid, /* color */, /* usage message */);
    if(!IsPlayerConnected(id))
        return SendClientMessage(playerid, /* color */, /* not connected message */);
    GetPlayerName(id, p_name, sizeof(p_name));
    TimesWarned[id]++;
    format(string, sizeof(string), "WarnID(%i) belongs to %s because of: %s", TimesWarned[id], p_name, reason);
    SendClientMessageToAll(/* color */, string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: