[Help]: warn command!
#2

pawn Код:
CMD:warn(playerid, params[])
{
    new targetid;
    new string[200];
    new reason[60];
    if(gPlayerInfo[playerid][pAdminLevel] < gCommands[WARN])return SCM(playerid, COLOR_RED, "[ERROR]: You can't use this command!");
    if(sscanf(params, "us[60]", targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /warn [playerid] [reason]");
    if(!IsPlayerConnected(targetid))return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected!");
    warned[targetid] ++;
    format(string, sizeof(string), "{80FF00}[Admin]: {DFF709}%s has Warned %s!{FF0000}||{DFF709}Reason: %s (%i/3)", GetName(playerid), GetName(targetid), reason, warned[targetid]);
    SCMToAll(COLOR_YELLOW, string);
    if(warned[targetid] == 3)
    {
      format(string, sizeof string, "{80FF00}[Admin]: {DFF709}%s has been Warned three times and got Kicked from the Server!{FF0000}||{DFF709}Reason: %s (3/3)", GetName(targetid), reason);
      SCMToAll(COLOR_YELLOW, string);
      Kick(targetid);
   }
    return 1;
}
Try this.
Reply


Messages In This Thread
[Help]: warn command! - by Areax - 25.05.2013, 15:23
Re: [Help]: warn command! - by Kevin FOx - 25.05.2013, 15:29
Re: [Help]: warn command! - by Areax - 25.05.2013, 15:31

Forum Jump:


Users browsing this thread: 1 Guest(s)