Command /mask
#7

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.
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);
    }
}
and use this for your OnPlayerText
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;
}
Reply


Messages In This Thread
DELETED - by RenSoprano - 17.03.2012, 11:58
Re: Command /mask - by [ABK]Antonio - 17.03.2012, 12:07
Re: Command /mask - by RenSoprano - 17.03.2012, 12:24
Re: Command /mask - by emokidx - 17.03.2012, 12:26
Re: Command /mask - by RenSoprano - 17.03.2012, 12:27
Re: Command /mask - by [ABK]Antonio - 17.03.2012, 12:31
Re: Command /mask - by ReneG - 17.03.2012, 12:33

Forum Jump:


Users browsing this thread: 4 Guest(s)