21.08.2010, 08:29
How to make that when a player types something the message will show only to near players??
I want like in LS-RP?
I want like in LS-RP?
public OnPlayerText(playerid, text[])
{
new Float:pPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerInRangeOfPoint(i, range, pPos[0], pPos[1], pPos[2]) continue;//Put sg instead of range
SendClientMessage(i, 0xffffffff, text);
}
return 0;
}
pawn Код:
|
LimitGlobalChatRadius(/*RADIUS*/);
new Float:x, Float:y, Float:z, string[128];
GetPlayerPos(playerid, x, y, z);
format(string, sizeof(string),"%s", text);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 10, x, y, z))
{
SendPlayerMessageToPlayer(i, playerid, string);
}
}