CMD:ban(playerid,params[])
{
if(pInfo[playerid][pAdminLevel] >= 2)
{
if(IsPlayerConnected(playerid))
{
new targetid,reason[105],string[256];
if(sscanf(params, "us[105]", targetid,reason)) return SendClientMessage(playerid,-1,""chat" /ban [playerid] [reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
format(string, sizeof(string), ""chat""COL_RED" %s %s has banned %s [Reason: %s]",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),reason);
SendClientMessageToAll(-1,string);
BanPlayer(targetid,reason,PlayerName(playerid));
}
}
else {
SendClientMessage(playerid,-1,""chat""COL_RED" You do not have the right admin permissions for this command!");
}
return 1;
}
if(killerid != INVALID_PLAYER_ID)
{
if(!PlayerShotPlayer[killerid][playerid])
{
new Admin[24] = "Anti-cheat";
new reason3[128] = "Fake Killing";
BanPlayer(playerid,reason3,Admin);
}
}
if(team[killerid] == TEAM_HUMAN)
{
if(GetPlayerSkin(killerid) == 0)
{
new Admin[24] = "Anti-cheat";
new reason3[128] = "Skin Hack (SI 0)";
BanPlayer(killerid,reason3,Admin);
}
}
Here's some
pawn Код:
pawn Код:
|
stock UnbanPlayer(ip[])
{
new string[32];
format(string, sizeof(string), "unban %s", ip);
SendRconCommand(string);
return 1;
}
stock UnbanPlayer(ip[])
{
new string[32];
format(string, sizeof(string), "unbanip %s", ip);
SendRconCommand(string);
SendRconCommand("reloadbans");
return 1;
}
#define COLOR_DARKRED 0xAA3333FF
CMD:unban(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); // Logging in, maybe you have it as [!IsPlayerConnected]
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); // Change it to whatever you want.
new string[128];
if(sscanf(params, "s[32]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /unban [name]");
new file[64], IP[16];
format(file, sizeof(file), "users/%s.ini", params); // Change it to the directory of the accounts.
if(dini_Exists(file))
{
if(dini_Int(file, "pBanned") == 0) return SendClientMessage(playerid, COLOR_GREY, "Player is not banned.");
format(IP, sizeof(IP), "%s", dini_Get(file, "IP"));
// Userfile
dini_IntSet(file, "pBanned", 0);
dini_IntSet(file, "Warns", 0);
dini_Set(file, "Warn1", "");
dini_Set(file, "Warn2", "");
dini_Set(file, "Warn3", "");
dini_Set(file, "BanReason", ""); // You've the rights to remove those if you don't have the system like that, Just comment them.
dini_Set(file, "BannedBy", "");
UnbanPlayer(ip[]); // The stock that was given.
format(string, sizeof(string), "AdmWarn: %s has unbanned %s.", RPN(playerid), params);
SendAdminMessage(COLOR_DARKRED, 1, string);
format(string, sizeof(string), "AdmWarn: %s (%s) has unbanned %s (%s).", RPN(playerid), RPIP(playerid), params, IP);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Player name not found.");
}
return 1;
}