Comanda /ban problem
#1

La aceasta comanda cum pot face ca player-ului banat sa ii trimita un mesaj,cum ar fi ai fost banat de "x" din motivul "y".Va multumesc anticipat!
Code:
CMD:ban(playerid, params[])
{
	if(!IsPlayerAdmin(playerid))
 	return SendClientMessage(playerid,COLOR_RED,"ERROR: You are not an administrator!");
	{
	    new targetid, tname[MAX_PLAYER_NAME], reason[128];
		new name[MAX_PLAYER_NAME], string[128];
		if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_YELLOW, "Correct Usage: /ban [playerid] [reason]");
		if(targetid != INVALID_PLAYER_ID)
		{
			GetPlayerName(playerid, name, sizeof(name));
			GetPlayerName(targetid, tname, sizeof(tname));
		    format(string, sizeof(string), "BAN:Admin  %s, (Reason: %s)", tname, reason);
		    SendClientMessageToAll(COLOR_LIGHTBLUE, string);
		    Ban(targetid);
		}
		else return SendClientMessage(playerid, COLOR_RED, "Player is not connected to the server");
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)