17.03.2012, 12:33
Umm, all the above code will only send whoever typed it the message, not to every one who is near you.
Add this anywhere outside of a callback in your script.
and use this for your OnPlayerText
Add this anywhere outside of a callback in your script.
pawn Code:
stock ProxDetector(Float:radi, playerid, string[],color)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
foreach(Player,i)
{
if(!IsPlayerConnected(i))continue;
if(IsPlayerInRangeOfPoint(i,radi,x,y,z)) SendClientMessage(i,color,string);
}
}
pawn Code:
public OnPlayerText(playerid, text[])
{
if(Masked[playerid] == 1)
{
new string[128];
format(string, sizeof(string), "Stranger says: %s", text);
ProxDetector(30,playerid,string,-1); // Sends the Stranger says message to anyone who is 30 gta units close to the player
return 1;
}
return 0;
}