26.05.2012, 14:21
Hi. I am currently creating a roleplay server from scratch and I have made the basics such as storing skins, levels, loading possitions from where you crashed etc. but now it is time for me to create admin commands. I just converted to YCMD, and I am not very familiar with this system, so if anyone could help me with the ban command, I'd be very grateful.
My current ban command is:
So that's okay, but I'd like to add a reason for the ban but I don't know how to add that.
My current ban command is:
pawn Код:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 1)
{
new str[128];
new id;
id = strval(params);
new playername[MAX_PLAYER_NAME+1];
new bannedname[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(id, bannedname, sizeof(bannedname));
format(str, sizeof(str), "AdmCmd: %s was banned by %s", bannedname, playername);
SendClientMessageToAll(COLOR_RED, str2);
BanPlayer(id);
}
return 1;
}