16.11.2013, 15:57
allright here,
put this at the bottom of your script
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.
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);
}
}
}
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;
}