25.11.2014, 02:16
I recommend using Prox Detector;
Create a Prox Detector stock some where near the top of your script
Then add on your OnPlayerText callback
For a in depth tutorial just look in tuts
Create a Prox Detector stock some where near the top of your script
pawn Код:
stock ProxDetector(Float:radi, playerid, string[],color)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
foreach(Player,i)
{
if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
{
SendClientMessage(i,color,string);
}
}
}
pawn Код:
public OnPlayerText(playerid, text[])
{
new
message[128];
format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
ProxDetector(30.0, playerid, message, -1);
return 0;
}