28.05.2013, 23:24
I've pieced together a /ban command using a few commands I've found on the forums and reflecting on my own system, I would like somebody to simply fix a few strings for me.
I would like to edit the command to make it so that when I ban the person, it sends a message to the whole server:
"Admin ADMINNAME banned PLAYERNAME. [Reason: CUSTOM REASON]"
Help please guys, much appreciated.
I would like to edit the command to make it so that when I ban the person, it sends a message to the whole server:
"Admin ADMINNAME banned PLAYERNAME. [Reason: CUSTOM REASON]"
Help please guys, much appreciated.
pawn Код:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] >=1)
{
new string[200];
new banner[24];
if(isnull(params)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /ban [playername]");
format(string,sizeof(string), "INFO: You have banned %s's account.", GetName(banner));
SendClientMessage(playerid, COLOR_INFO, string);
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File,"Banned",1);
INI_Close(File);
Ban(playerid);
return 1;
}
else return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You are unauthorized to use this command.");
}