BAN Command
#10

CMD:ban(playerid, params[])
{
new targetid, reason[128];

if(PlayerInfo[playerid][pAdmin] < 2)
{
return SendClientMessage(playerid, COLOR_IVORY, "You are not authorized to use this command.");
}
if(sscanf(params, "us[128]", targetid, reason))
{
return SendClientMessage(playerid, COLOR_IVORY, "USAGE: /ban [playerid] [reason]");
}
if(!IsPlayerConnected(targetid))
{
return SendClientMessage(playerid, COLOR_IVORY, "The player specified is disconnected.");
}
if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin])
{
return SendClientMessage(playerid, COLOR_IVORY, "The player specified has a higher admin level than you. They cannot be banned.");
}

Log_Write("log_punishments", "%s (uid: %i) banned %s (uid: %i), reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason);

SendClientMessageToAllEx(COLOR_IVORY, "AdmCmd: %s was banned by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason);
BanPlayer(targetid, GetPlayerNameEx(playerid), reason);
return 1;
}
Reply


Messages In This Thread
BAN Command - by SeanDenZYR - 10.12.2016, 13:05
Re: BAN Command - by SyS - 10.12.2016, 13:33
Re: BAN Command - by saffierr - 10.12.2016, 14:07
Re: BAN Command - by silverms - 10.12.2016, 18:03
Re: BAN Command - by Luicy. - 11.12.2016, 12:22
Re: BAN Command - by ISmokezU - 11.12.2016, 12:43
Re: BAN Command - by BiosMarcel - 11.12.2016, 12:58
Re: BAN Command - by ISmokezU - 11.12.2016, 13:25
Re: BAN Command - by BiosMarcel - 11.12.2016, 13:31
Re: BAN Command - by DJefferson - 09.03.2018, 20:30

Forum Jump:


Users browsing this thread: 3 Guest(s)