How to send a message to near players
#6

allright here,

put this at the bottom 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);
        }
    }
}
and heres the command, 30 is the range from the player, so if ure 30 close to the player typing /dice you will recieve the message.
pawn Код:
CMD:dice(playerid, params[])
{
    new randMSG = random(sizeof(RandomMSG)); //calculates the size of RandomMSG (which is 3)
    SendClientMessageToAll(COLOR_PURPLE, RandomMSG[randMSG]); // Replace the "color" with your defined color.
    ProxDetector(30, playerid, string, COLOR_GREY);
    return 1;
}
Reply


Messages In This Thread
How to send a message to near players - by bustern - 16.11.2013, 15:32
Re: How to send a message to near players - by Voxel - 16.11.2013, 15:36
Re: How to send a message to near players - by bustern - 16.11.2013, 15:43
Re: How to send a message to near players - by Patrick - 16.11.2013, 15:47
Re: How to send a message to near players - by bustern - 16.11.2013, 15:51
Re: How to send a message to near players - by Voxel - 16.11.2013, 15:57
Re: How to send a message to near players - by bustern - 16.11.2013, 16:14
Re: How to send a message to near players - by Voxel - 16.11.2013, 16:19
Re: How to send a message to near players - by Patrick - 16.11.2013, 16:20
Re: How to send a message to near players - by bustern - 16.11.2013, 16:23

Forum Jump:


Users browsing this thread: 2 Guest(s)