Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Need A Oban Command!

$
0
0
Code:-
Quote:

Code:
COMMAND:ban(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
if(playerData[playerid][playerLevel] >= 3)
{
new otherID, playersIP[24], playerName[24], adminName[24], message[248], reason[300];

if(sscanf(params, "us[300]", otherID, reason))
{
SendClientMessage(playerid, COLOR_WHITE, "{FF0770}[Admin] Usage: \"ban <playername/id> <reason>\"");
}
else
{
if(IsPlayerConnected(otherID))
{
if(playerData[otherID][playerLoggedIn])
{
if(playerData[playerid][playerLevel] >= playerData[otherID][playerLevel])
{
new aMsg[300];
GetPlayerName(otherID, playerName, sizeof(playerName));
GetPlayerName(playerid, adminName, sizeof(adminName));
GetPlayerIp(otherID, playersIP, sizeof(playersIP));
new log[250];
format(aMsg, sizeof(aMsg), "{FF0770}[ADMIN] {FFFFFF}%s(%i) has banned %s(%i) {FE9A2E}[REASON: %s]{FFFFFF}", playerData[playerid][playerNamee], playerid, playerData[otherID][playerNamee], otherID, reason);
SendClientMessageToAll(COLOR_WHITE, aMsg);
format(log, sizeof(log), "%s(%i) has banned %s(%i)", playerData[playerid][tempAdminName], playerid, playerName, otherID);
SendAdminText(playerid, log);

new banreason[350];
format(banreason, sizeof(banreason), "INSERT INTO `playerbans` (`banned_by`, `banned_for`, `player_banned`, `player_ip`) VALUES ('%s', '%s', '%s', '%s')", adminName, reason, playerName, playersIP);
mysql_query(banreason, MYSQL_ADD_BAN, playerid, connection);

KickWithMessage(otherID, "[BANNED] You have been banned. You may appeal on -HIDDEN-.com");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You cannot use this command on that player.");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is not logged in!");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is not online!");
}
}
}
else
{
return 0;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands.");
}

return 1;
}
Plz Can Anyone Create A Off Ban Command For me With This Code Of Ban!

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>