/unban
#10

Код:
CMD:unban(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ? // expect for "?" input admin level
	{
		new string[128];
		if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /unban [playername]");

		if(doesAccountExist(params))
		{
			OnPlayerOfflineLogin(params);
			if( PlayerInfo[MAX_PLAYERS][pPermaBanned] == 3 )
			{
				SendClientMessageEx( playerid, COLOR_WHITE, "Permanently banned accounts can only be unbanned via FTP." );
			}
			else
			{
				if( PlayerInfo[MAX_PLAYERS][pBanned] >= 1 )
				{
					PlayerInfo[MAX_PLAYERS][pBanned] = 0;
					PlayerInfo[MAX_PLAYERS][pWarns] = 0;
					PlayerInfo[MAX_PLAYERS][pDisabled] = 0;
					RemoveBan(PlayerInfo[MAX_PLAYERS][pIP]);
					print("OnPlayerOfflineLogin: Saving variables to file");
					OnPlayerOfflineSave(params);
					print("OnPlayerOfflineLogin: Variables saved properly");
					format(string, 128, "AdmCmd: %s (IP:%s) was unbanned by %s.", params, PlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid));
					ABroadCast(COLOR_LIGHTRED,string,2);
					new year, month,day;
					getdate(year, month, day);
					format(string, sizeof(string), "AdmCmd: %s (IP:%s) was unbanned by %s. (%d-%d-%d)", params, PlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid),month,day,year);
					Log("logs/ban.log", string);
					print(string);
				}
				else
				{
					SendClientMessageEx( playerid, COLOR_WHITE, "Not a banned account!" );
				}
			}
		}
		else
		{
			SendClientMessageEx( playerid, COLOR_WHITE, "That account doesn't exist." );
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}
Reply


Messages In This Thread
/unban - by Fernado Samuel - 22.02.2013, 00:29
Re: /unban - by PabloDiCostanzo - 22.02.2013, 00:33
Re: /unban - by Fernado Samuel - 22.02.2013, 00:33
Re: /unban - by PabloDiCostanzo - 22.02.2013, 00:35
Re: /unban - by Fernado Samuel - 22.02.2013, 00:37
Re: /unban - by PabloDiCostanzo - 22.02.2013, 00:38
Re: /unban - by Ananisiki - 22.02.2013, 00:43
Re: /unban - by Fernado Samuel - 22.02.2013, 00:48
Re: /unban - by Fernado Samuel - 22.02.2013, 13:33
Re: /unban - by Nivniv2 - 22.02.2013, 13:38

Forum Jump:


Users browsing this thread: 3 Guest(s)