17.12.2012, 03:28
help please use the command when the server restarts unban
ban
unban
ban
Код:
CMD:ban(playerid, params[]) { if(Info[playerid][pstaff] >= 2) { new targetid, reason; new VBName[MAX_PLAYER_NAME]; new VBName1[MAX_PLAYER_NAME]; GetPlayerName(playerid, VBName, MAX_PLAYER_NAME); GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME); if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_RED,"Usage: /Ban [playerid] [reason]"); if(targetid == playerid) return SendClientMessage(playerid, COLOR_RED, "You Can't Ban Yourself!"); if(Info[targetid][pstaff] > Info[playerid][pstaff]) return SendClientMessage(playerid, COLOR_RED, "You Can't Kick Higher Administrators!"); else { new str[128]; format(str, sizeof(str), "Administrator %s Has Banned %s Reason: %d!", VBName, VBName1, reason); SendClientMessageToAll(COLOR_RED,str); Info[playerid][pBanned] = 1; Ban(targetid); } } else return SendClientMessage(playerid, COLOR_RED, "You Need To Be A Administrator!"); return 1; }
Код:
CMD:unban(playerid, params[]) { if(Info[playerid][pstaff] >= 2) { new string[128]; if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [playername]"); if( Info[MAX_PLAYERS][pBanned] >= 2 ) { Info[MAX_PLAYERS][pBanned] = 0; print("OnPlayerOfflineLogin: Variables saved properly"); format(string, 128, "[ADMIN] %s (IP:%s) was unbanned by %s.", params, Info[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid)); ABroadCast(COLOR_RED,string); new year, month,day; getdate(year, month, day); new playa[MAX_PLAYER_NAME]; GetPlayerName(playerid, playa, MAX_PLAYER_NAME); format(string, sizeof(string), "[ADMIN] %s : was unbanned by %s.", params, playa); ABroadCast(COLOR_RED, string); } else { SendClientMessage( playerid, COLOR_WHITE, "Not a banned account or no such account was found!" ); } } return 1; }