SA-MP Forums Archive
Message in range - How? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Message in range - How? (/showthread.php?tid=404920)



Message in range - How? - FL3GM4 - 04.01.2013

how to make command which will put text in IC chat in range!?

Код:
CMD:e(playerid, params[])
{
	new tekst[128], string[128], id;
	new Float:x, Float:y, Float:z;
	if(PlayerInfo[playerid][pAdmin] < 1)return SendClientMessage(playerid, COLOR_WHITE, ""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE"Niste ovlasteni za ovu komandu");
	else if(sscanf(params, "s[128]", tekst))return SendClientMessage(playerid, COLOR_WHITE, "/e [Tekst]");
	GetPlayerPos(playerid, x, y, z);
	foreach (new i : Player)
    if(IsPlayerInRangeOfPoint(playerid, 50.0, x, y, z))
    {
        format(string, sizeof(string), "(( Admin %s: %s ))", PlayerName(playerid), tekst);
        SendClientMessage(id, -1, string);
    }
	return 1;
}
its buggy ...


Re: Message in range - How? - ReVo_ - 04.01.2013

format(string, sizeof(string), "(( Admin %s: %s ))", PlayerName(playerid), tekst); // better here
foreach (new i : Player)
{
if(IsPlayerInRangeOfPoint(i, 50.0, x, y, z))
{

SendClientMessage(i, -1, string);
}
}