Chat with range:
#4

Код:
CMD:s(playerid,params[]) {
	if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /s [text] to talk to nearest person");
	new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name));
	new string[128], Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	format(string, sizeof(string), "[%s] says: %s", Name, params[0]);
	new str[128];
	format(str, sizeof(str),"[SAY] %s: %s", Name, params[0]);
	printf("%s", string);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,50.0, x, y, z) ) SendClientMessage(i, COLOR_RED, string);
	}
	return 1;
}
Paste this cmd, if u get errors!
Edit: identation is also fixed,ok gshock
Reply


Messages In This Thread
Chat with range: - by LostGaming2014 - 23.03.2014, 03:45
Re: Chat with range: - by HitterHitman - 23.03.2014, 03:54
Re: Chat with range: - by ChristianIvann09 - 23.03.2014, 03:56
Re: Chat with range: - by Hanuman - 23.03.2014, 04:33
Re: Chat with range: - by GShock - 23.03.2014, 04:35

Forum Jump:


Users browsing this thread: 1 Guest(s)