CMD:ban(playerid, params[]) { if(!IsLoggedEx(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login before using any commands."); if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid)) { new giveplayerid, reason, log[250]; if(!sscanf(params, "us[250]", giveplayerid, reason)) { if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you."); if(!IsPlayerConnected(giveplayerid)) { SendClientMessage(playerid, COLOR_WHITE, "That player is not connected."); } else { new string[256]; format(string, sizeof(string), "System: %s has been banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); SendClientMessageToAll(COLOR_ORANGE, string); format(log, sizeof(log), "BAN: %s was banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); Log("Logs/Ban.log", log); PlayerInfo[giveplayerid][pBanned] = 1; AddBan(GetPlayerIpEx(giveplayerid)); } } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Ban [Player ID] [Reason]"); } } return 1; } CMD:systemban(playerid, params[]) { if(!IsLoggedEx(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login before using any commands."); if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid)) { new giveplayerid, reason, log[128]; if(!sscanf(params, "us[128]", giveplayerid, reason)) { if(!IsPlayerConnected(giveplayerid)) { SendClientMessage(playerid, COLOR_WHITE, "That player is not connected."); } else { new string[256]; format(string, sizeof(string), "System: %s has been Auto-Banned by the System. Reason: %s.", PlayerName(giveplayerid), reason); SendClientMessageToAll(COLOR_BRIGHTRED, string); format(log, sizeof(log), "SYSTEM-BAN: %s was System-Banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); Log("Logs/Ban.log", log); PlayerInfo[giveplayerid][pBanned] = 1; AddBan(GetPlayerIpEx(giveplayerid)); } } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /SystemBan [Player ID] [Reason]"); } } return 1; }
CMD:ban(playerid, params[]) { if(!IsLoggedEx(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login before using any commands."); if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid)) { new giveplayerid, reason[250], log[250]; if(!sscanf(params, "us[250]", giveplayerid, reason)) { if(!IsPlayerConnected(giveplayerid)) { SendClientMessage(playerid, COLOR_WHITE, "That player is not connected."); } else { if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you."); new string[256]; format(string, sizeof(string), "System: %s has been banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); SendClientMessageToAll(COLOR_ORANGE, string); format(log, sizeof(log), "BAN: %s was banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); Log("Logs/Ban.log", log); PlayerInfo[giveplayerid][pBanned] = 1; AddBan(GetPlayerIpEx(giveplayerid)); } } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Ban [Player ID] [Reason]"); } } return 1; }
CMD:ban(playerid, params[])
{
if(!IsLoggedEx(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login before using any commands.");
if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
{
new giveplayerid, reason[64], log[250];
if(!sscanf(params, "us[64]", giveplayerid, reason))
{
if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you.");
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, COLOR_WHITE, "That player is not connected.");
}
else
{
new string[256];
format(string, sizeof(string), "System: %s has been banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason);
SendClientMessageToAll(COLOR_ORANGE, string);
format(log, sizeof(log), "BAN: %s was banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason);
Log("Logs/Ban.log", log);
PlayerInfo[giveplayerid][pBanned] = 1;
AddBan(GetPlayerIpEx(giveplayerid));
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Ban [Player ID] [Reason]");
}
}
return 1;
}
CMD:systemban(playerid, params[])
{
if(!IsLoggedEx(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login before using any commands.");
if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
{
new giveplayerid, reason[64], log[128];
if(!sscanf(params, "us[64]", giveplayerid, reason))
{
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, COLOR_WHITE, "That player is not connected.");
}
else
{
new string[256];
format(string, sizeof(string), "System: %s has been Auto-Banned by the System. Reason: %s.", PlayerName(giveplayerid), reason);
SendClientMessageToAll(COLOR_BRIGHTRED, string);
format(log, sizeof(log), "SYSTEM-BAN: %s was System-Banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason);
Log("Logs/Ban.log", log);
PlayerInfo[giveplayerid][pBanned] = 1;
AddBan(GetPlayerIpEx(giveplayerid));
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /SystemBan [Player ID] [Reason]");
}
}
return 1;
}
new string[64]
format(string, sizeof(string), "Admin %s (ID:%d) has banned you for: %s",PlayerName(playerid), playerid, reason);
SendClientMessage(giveplayerid, -1, string);
Anyway, is there a way it can show the player the reason before they lose connection?
|