23.12.2012, 13:59
Hello.
I just made my ban command and it won't work..
If I use /ban 1 goaway it will display me the USAGE thing...
What's wrong?
Thank you.
I just made my ban command and it won't work..
Код:
CMD:ban(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new PID; //define the playerid we wanna ban new reason[64]; //the reason, put into a string 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)); 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!"); format(str, sizeof(str), "[BAN] '%s' has been banned by administrator '%s'. Reason: %s ", Playername, Adminname, reason); SendClientMessageToAll(COLOR_ACHIEVEMENT, str); Ban(PID); }else{ SendClientMessage(playerid, COLOR_ERROR, "[ERROR] Only admins can use this command. Use /help."); } return 1; }
What's wrong?
Thank you.