15.04.2018, 15:34
Quote:
|
It's good for me. Only there is a problem, the player leaves /q and changes from BanReason=None to BanReason=
Код:
CMD:ban(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new string[256], id, reason[50];
if(sscanf(params, "us[50]", id, reason)) return SendClientMessage(playerid, COLOR_GREY, "Usage /ban [ID] [Reason]");
if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "There is no such player.");
format(string, sizeof(string), "AdmCmd: %s has been banned from Admin %s, Reason: %s.", pName(id), pName(playerid), reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
format(PlayerInfo[id][pBanReason], 128, "%s", reason);
PlayerInfo[id][pBanned] = 1;
BanEx(id, reason);
}
else
{
SCM(playerid, -1, "You are not an administrator!");
}
return 1;
}
|
PHP код:
CMD:ban(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new string[256], id, reason[50];
if(sscanf(params, "us[50]", id, reason)) return SendClientMessage(playerid, COLOR_GREY, "Usage /ban [ID] [Reason]");
if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "There is no such player.");
format(string, sizeof(string), "AdmCmd: %s has been banned from Admin %s, Reason: %s.", pName(id), pName(playerid), reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
PlayerInfo[id][pBanReason]= reason;
PlayerInfo[id][pBanned] = 1;
BanEx(id, reason);
}
else
{
SCM(playerid, -1, "You are not an administrator!");
}
return 1;
}

