30.09.2016, 13:59
You can either use/try this:
or this: (Recommend)
PHP код:
CMD:ban(playerid, params[])
{
if(pInfo[playerid][AL] < 2) return SCM(playerid, red, "[ERROR] No allow!");
{
new PID;
new reason[64];
new str[128];
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
if(sscanf(params, "us[64]", PID,reason)) return SCM(playerid, red, "[U]: /ban playerid) reason)");
if(!IsPlayerConnected(PID)) return SCM(playerid, -1, "[ERROR]: no player!");
GetPlayerName(playerid, Adminname, sizeof(Adminname));
GetPlayerName(PID, Playername, sizeof(Playername));
format(str, sizeof(str), "%s has been banned by Administrator %s Reason: %s", Playername, Adminname, reason);
SCMToAll(-1, str);
Ban(PID);
}
return 1;
}
PHP код:
CMD:ban(playerid, params[])
{
if(pInfo[playerid][AL] < 2) return SCM(playerid, red, "[ERROR] No allow!");
{
new PID;
new reason[64];
new str[128];
if(sscanf(params, "us[64]", PID,reason)) return SCM(playerid, red, "[U]: /ban playerid) reason)");
if(!IsPlayerConnected(PID)) return SCM(playerid, -1, "[ERROR]: no player!");
format(str, sizeof(str), "%s has been banned by Administrator %s Reason: %s", GetName(PID), GetName(playerid), reason);
SCMToAll(-1, str);
Ban(PID);
}
return 1;
}
GetName(playerid)
{
new itsPlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, itsPlayerName, sizeof(itsPlayerName));
return itsPlayerName;
}