[Pedido] /ban
#7

Код:
CMD:banip(playerid, params[])
{
	// Setup local variables
	new PlayerToBan, Reason[128], Msg[9000], Name[24], AdminName[24];


	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Check if the player's admin-level is at least 3
		if(IsPlayerAdmin(playerid))
		{
			if (sscanf(params, "us[128]", PlayerToBan, Reason))
				SendClientMessage(playerid, -1, "» {E0C060}Uso: /banip [id] [motivo]");
			else
			{
				if (IsPlayerConnected(PlayerToBan))
				{
					// Get the names of the player and the admin who executed the ban
					GetPlayerName(playerid, AdminName, sizeof(AdminName));
					GetPlayerName(PlayerToBan, Name, sizeof(Name));

					// Inform the player about his ban
					format(Msg, 128, "» {808080}Vocк teve o IP banido permanentemente por {FFFFFF}%s", AdminName);
					SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
					format(Msg, 128, "» {808080}Motivo: {FFFFFF}%s", Reason);
					SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);

					// Ban the player with a reason
					BanEx(PlayerToBan, Reason);

					// Inform everybody else which player was ip-banned
					format(Msg, 9000, "{B3A792}O Administrador {FFFFFF}%s {B3A792}baniu o IP de {FFFFFF}%s{B3A792}!", AdminName, Name);
					SendClientMessageToAll(0xFFFFFFFF, Msg);
					EscreverLog("Ban", Msg);
				}
			}
		}
		else
  			SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}[ERRO] {009D4F}Vocк nгo tem permissгo para usar este comando!");
	}
	else
	    return false;

	return true;
}
Reply


Messages In This Thread
/ban - by RockstarVidaloka - 01.12.2013, 21:56
Re: /ban - by iTzDemon - 01.12.2013, 22:12
Re: /ban - by RockstarVidaloka - 01.12.2013, 22:20
Re: /ban - by zG - 01.12.2013, 22:26
Re: /ban - by StreetGT - 01.12.2013, 22:51
Re: /ban - by NurbWill - 01.12.2013, 23:55
Re: /ban - by JoaoMonteiro452 - 02.12.2013, 00:39
Re: /ban - by RockstarVidaloka - 02.12.2013, 11:08

Forum Jump:


Users browsing this thread: 1 Guest(s)