Ban won't work?
#9

This should work if you are RCON Admin.
pawn Код:
CMD:ban(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR] Only admins can use this command. Use /help.");
    new PID; //define the playerid we wanna ban
    new reason[64]; //the reason, put into a string
    if(sscanf(params, "us[64]", PID, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /ban [playerid] [reason]");
    if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR] The player is not connected!");
    new str[128]; //a new message string max 128
    new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Adminname, sizeof(Adminname));
    GetPlayerName(PID, Playername, sizeof(Playername));
    format(str, sizeof(str), "[BAN] '%s' has been banned by administrator '%s'. Reason: %s ", Playername, Adminname, reason);
    SendClientMessageToAll(COLOR_ACHIEVEMENT, str);
    Ban(PID);
    return 1;
}
Reply


Messages In This Thread
Ban won't work? - by jNkk - 23.12.2012, 13:59
Re: Ban won't work? - by SiRbEaSt - 23.12.2012, 14:01
Re: Ban won't work? - by jNkk - 23.12.2012, 14:12
Re: Ban won't work? - by SiRbEaSt - 23.12.2012, 14:14
Re: Ban won't work? - by YoYo123 - 23.12.2012, 14:43
Re: Ban won't work? - by TheSecrets - 23.12.2012, 15:41
Re: Ban won't work? - by ViruZz - 23.12.2012, 16:22
Re: Ban won't work? - by jNkk - 23.12.2012, 18:58
Re: Ban won't work? - by Konstantinos - 23.12.2012, 19:21

Forum Jump:


Users browsing this thread: 3 Guest(s)