message multiple
#1

Код:
CMD:warn(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] == 0)
		return SendClientMessage(playerid, COLOR_RED, "ERROR: Insufficient Permissions!");
		
	new PID, str[128], reason[64], name[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
	if(sscanf(params, "us[64]", PID,reason))
		return SendClientMessage(playerid, COLOR_LIGHTGREEN, "Usage: /Warn [playerid] [reason]");

	if(!IsPlayerConnected(PID))
		return SendClientMessage(playerid, COLOR_RED, "Player is not connected!");

	playerWarn[PID] ++;
	GetPlayerName(playerid, Adminname, sizeof(Adminname));
	GetPlayerName(PID, name, sizeof(name));
	format(str, sizeof str, "Admin %s has warned %s, Reason: %s. [Warning %i/3]", Adminname, PID, reason, playerWarn[PID]);
	SendClientMessageToAll(COLOR_RED, str);
	format(str, sizeof str, "Admin %s has warned %s, Reason: %s. [Warning %i/3]", Adminname, PID, reason, playerWarn[PID]);
	SendClientMessageToAll(COLOR_RED, str);
	if(playerWarn[PID] > 2)
	{
		format(str, sizeof str, "%s has been kicked by server 3 warnings, Reason [%s].", name, reason);
			SendClientMessageToAll(COLOR_RED, str);
			SendClientMessage(PID, COLOR_RED, "You were warned three times and got kicked!");
		Kick(PID);
	}
	return 1;
}
Hey, the command works just fine and compiling as well but I'm getting a multiple message like :

Admin %s has warned %s, Reason: %s. [Warning %i/3]
Admin %s has warned %s, Reason: %s. [Warning %i/3]

Or:

%s has been kicked by server 3 warnings, Reason [%s]
%s has been kicked by server 3 warnings, Reason [%s]

I need to put the 'ClientMessage' out of the loop, anyone knows how?
Reply


Messages In This Thread
message multiple - by rakinz - 24.11.2017, 11:24
Re: message multiple - by Kane - 24.11.2017, 11:29
Re: message multiple - by rakinz - 24.11.2017, 12:07
Re: message multiple - by Kraeror - 24.11.2017, 12:25
Re: message multiple - by TaiRinsuru - 24.11.2017, 12:39
Re: message multiple - by Lucases - 24.11.2017, 14:02

Forum Jump:


Users browsing this thread: 1 Guest(s)