20.02.2016, 11:09
How do I create a system in which when you type something,in normal chat,the message only sends to players in the radius?I need help fasstttt.
public OnPlayerText(playerid, text[]) { new pText[144]; format(pText, sizeof (pText), "(%d) %s", playerid, text); SendPlayerMessageToAll(playerid, pText); return 0; // ignore the default text and send the custom one }
public OnPlayerText(playerid, colore, text[])
{
GetPlayerPos(playerid,XPos,YPos,ZPos);
for(new i=0;i<MAX_PLAYERS,i++)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, RANGEYOUCHOOSE, XPos, YPos, ZPos) && GetPlayerVirtualWorld(i)==GetPlayerVirtualWorld(playerid)) SendPlayerMessageToPlayer(i, playerid, text);
}
return 0;
}
public OnPlayerText(playerid, text[])
{
new RangeText[200],Name[24],Float:x,Float:y,Float:z;
GetPlayerName(playerid,Name,sizeof(Name));
format(RangeText, sizeof (RangeText), "%s says: %s", Name, text);
GetPlayerPos(playerid,x,y,z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i,10,x,y,z);
{
SendClientMessage(i,-1,RangeText);
}
}
return 0;
}