Question
#10

You need to get the player's name, also returning in a loop is not so much recommended because itll stop it.

Код:
CMD:jail(playerid, params[]) 
{
	new 
		name[MAX_PLAYER_NAME], 
		string[45 + MAX_PLAYER_NAME]
	;

	GetPlayerName(playerid, name, MAX_PLAYER_NAME);

	SendClientMessage(playerid, -1, "You are jailed for 5 minutes. Reason: Unknown."); 

	format(string, sizeof (string), "%s is jailed for 5 minutes. Reason: Unknown.", name); 

	for(new i; i != MAX_PLAYERS; i++) 
	{ 
		if (!IsPlayerConnected(playerid))
			continue;

		if (i == playerid)
			continue;
			
		SendClientMessage(i, -1, string); 
	} 

	return 1;
}
Reply


Messages In This Thread
Question - by bgedition - 26.04.2015, 17:25
Re: Question - by Mencent - 26.04.2015, 17:29
Re: Question - by bgedition - 26.04.2015, 17:33
Re: Question - by Mencent - 26.04.2015, 17:35
Re: Question - by Emp3r0r - 26.04.2015, 17:36
Re: Question - by Emp3r0r - 26.04.2015, 17:38
Re: Question - by bgedition - 26.04.2015, 18:09
Re: Question - by Konstantinos - 26.04.2015, 18:12
Re: Question - by bgedition - 26.04.2015, 18:15
Re: Question - by Evocator - 26.04.2015, 18:17

Forum Jump:


Users browsing this thread: 1 Guest(s)