23.12.2012, 18:58
Tried everything, still won't work? I just can't figure out what's wrong...
Here is the script again if you need it:
Here is the script again if you need it:
Код:
CMD:ban(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new PID; 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 [id] [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 admin '%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; }