06.07.2017, 00:45
(
Last edited by KingSenpai; 06/07/2017 at 01:03 AM.
Reason: Wrong image link
)
Everytime i ban a player all user getting kicked out from the server
Code:
CMD:ban(playerid, params[])
{
new targetid, reason[128];
if(PlayerInfo[playerid][pAdmin] < 2)
{
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
}
if(sscanf(params, "us[128]", targetid, reason))
{
return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /ban [playerid] [reason]");
}
if(!IsPlayerConnected(targetid))
{
return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected.");
}
if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin])
{
return SendClientMessage(playerid, COLOR_GREY, "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_LIGHTRED, "AdmCmd: %s was banned by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason);
BanPlayer(targetid, GetPlayerNameEx(playerid), reason);
return 1;
}


