18.05.2013, 15:11
Код:
//============================================================================== dcmd_unban(playerid, params[]) { if(PlayerInfo[playerid][AdminLevel] >= 2) { new PlayerFile[50],string[128]; format(PlayerFile, sizeof(PlayerFile), "Saves/%s.ini", params); if(!strlen(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /unban [playername]"); if(!dini_Exists(PlayerFile)){SendClientMessage(playerid, COLOR_GREY, "No such player found in the database.");} else { if(dini_Int(PlayerFile,"Banned")==0)return SendClientMessage(playerid,-1,"That Player is already unbanned"); dini_IntSet(PlayerFile, "Banned", 0); SendClientMessage(playerid, COLOR_WHITE, "Account Unbanned"); format(string,sizeof(string),"unbanip %s",dini_Get(PlayerFile,"IP")); SendRconCommand(string); } }else return 0; return 1; } //============================================================================== dcmd_ban(playerid, params[]) { if(PlayerInfo[playerid][AdminLevel] >= 3) { new PlayerFile[50]; format(PlayerFile, sizeof(PlayerFile), "Saves/%s.ini", params); if(!strlen(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /oban [playername]"); if(!dini_Exists(PlayerFile)) {SendClientMessage(playerid, COLOR_GREY, "No such player found in the database.");} else { if(dini_Int(PlayerFile,"Banned")==1)return SendClientMessage(playerid,-1,"That Player is already banned"); dini_IntSet(PlayerFile, "Banned", 1); SendClientMessage(playerid, COLOR_WHITE, "Account Banned");} }else return 0; return 1; }
and they can play on the server until they relog...
i need help with making the command also banning their ip and "closes the connection"
/ban (iD) (reason)
/unban (iD)