Quote:
Originally Posted by expertprogrammer
Here is my old /ban cmd modify for your needs:
pawn Код:
dcmd_ban(playerid, params[]) { if(IsPlayerAdmin2[playerid] == 2) { new level; new pid; if (sscanf(params, "us", pid, level)) { SendClientMessage(playerid, 0xFF0000AA, "USAGE: /ban [ID] [Reason] - Ban a rule-breaker."); } else if (pid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found"); else { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); new pname[MAX_PLAYER_NAME]; GetPlayerName(pid, pname, sizeof(pname)); new string[256]; format(string, sizeof(string), "Administrator %s have banned %s for: %s", name, pname, level); SendClientMessageToAll(COLOR_BLUE, string); Ban(pid); } return 1; } else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be an admin level 4 or higher to use this command.");
Note: You got to fix colors and messages to get this working.
|
Thanks dude i fix this i just forgot to return...
pawn Код:
if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /banid <playerid> <reason>");
FIXED