mysql zcmd ban and unban command
#2

On top of your script
Код:
 new IsPlayerBanned[MAX_PLAYERS] = 0;
here's the command
Код:
COMMAND:ban(playerid, params[])
{
	new pID, reason[64];
	if(!sscanf(params, "us", pID, reason))
	{
	    if(PlayerInfo[playerid][pAdmin] >= 1)
		{
		    if(PlayerInfo[playerid][pAdminDuty] == 1)
		    {
			    new string[128];
			    new adminname[MAX_PLAYER_NAME];
			    new playername[MAX_PLAYER_NAME];

			    GetPlayerName(playerid, adminname, sizeof(adminname));
			    GetPlayerName(pID, playername, sizeof(playername));

				format(string, sizeof(string), "AdmCmd: %s has been banned by %s, Reason:%s", playername, adminname, reason);
				SendClientMessageToAll(COLOR_RED, string);
				Ban(pID);
                                IsPlayerBanned[playerid] = 1;
			}
			else return SendClientMessage(playerid, COLOR_GREY, "You need to be on admin duty in order to use this feature (/aduty)");
		}
		else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not authorised to use this command ::.");
	}
	else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [PlayerID/PartOfName] [Reason]");
	return 1;
}
Same concept applies for the unban command.
Reply


Messages In This Thread
mysql zcmd ban and unban command - by sanrock - 01.06.2012, 15:56
Re: mysql zcmd ban and unban command - by Sandiel - 01.06.2012, 16:13

Forum Jump:


Users browsing this thread: 2 Guest(s)