[HELP] Radio/ProxDetector - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Radio/ProxDetector (
/showthread.php?tid=438561)
[HELP] Radio/ProxDetector -
FreddeN93 - 20.05.2013
Hi,
I'm trying to make a similar radio command found on Los Santos Role Play. When the player performs a radio message, he shall only see the SendFactionMessage text. But I want players near him to be able to see what he just said in his radio using ProxDetector. I know how to make this, but the problem is that the player sending the message see both the SendFactionMessage and ProxDetector. He should ONLY see SendFactionMessage.
pawn Код:
format(string, sizeof(string), "** %s: %s", sendername, result);
SendFactionMessage(5, COLOR_RADIO, string);
format(string, sizeof(string), "* %s %s", sendername, result);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
Or, if you got another solution to this, shoot.
Respuesta: [HELP] Radio/ProxDetector -
JustBored - 20.05.2013
you will have to make another proxdetector function (copy the actual one) and add one if that would be like this:
of course after the loop. So the code would be:
pawn Код:
public ProxDetector2(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i< MAX_PLAYERS; i++)
{
if(playerid != i)
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientPlayerMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientPlayerMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}//not connected
return 1;
}
Re: [HELP] Radio/ProxDetector -
FreddeN93 - 21.05.2013
Thanks alot -- worked just fine!