SA-MP Forums Archive
What is the best "ProxDetector" for RP chat system - 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: What is the best "ProxDetector" for RP chat system (/showthread.php?tid=636504)



What is the best "ProxDetector" for RP chat system - EtayJ - 28.06.2017

Hello!
I have heard several times that ProxDetector is outdated, what is the best up to date ProxDetector that I can use?


Re: What is the best "ProxDetector" for RP chat system - Dignity - 28.06.2017

https://gist.github.com/ziggi/40edaf...10d3218873fd02


Re: What is the best "ProxDetector" for RP chat system - EtayJ - 28.06.2017

Cheers!


Re: What is the best "ProxDetector" for RP chat system - EtayJ - 28.06.2017

Hi again.
A few questions - what is the color parameter? I get an argument type mismatch
What is he doing in this line and what is the '>>' operator?
PHP Code:
color_r float(color >> 24 0xFF); 



Re: What is the best "ProxDetector" for RP chat system - Meller - 28.06.2017

To be honest, why not create your own stock? It's too easy.

Here's something from my mind:
PHP Code:
stock SendCloseMessage(playeridcolormessage[], Float:range 2.5) {
     new 
Float:xFloat:yFloat:z;
     
GetPlayerPos(playeridxyz);
     for(new 
targetid 0maxplayerid GetPlayerPoolSize(); targetid <= maxplayeridtargetid++)
          if(
IsPlayerConnected(targetid) && IsPlayerInRangeOfPoint(targetidrangexyz))
               
SendClientMessage(targetidcolormessage);

usage:
PHP Code:
CMD:me(playeridparams[]) {
     new 
action[144];
     if(!
sscanf(params"s[144]"action)) {
          new 
message[144], name[MAX_PLAYER_NAME];
          
GetPlayerName(playeridMAX_PLAYER_NAMEname);
          
format(message144"* %s %s"nameaction);
          
SendCloseMessage(playerid, -1message10);
     }
     else 
SendClientMessage(playerid, -1"Usage: /me action");
     return 
1;

Both of these was written in the browser. See how easy it is?


Re: What is the best "ProxDetector" for RP chat system - ranme15 - 29.06.2017

Quote:
Originally Posted by Meller
View Post
To be honest, why not create your own stock? It's too easy.

Here's something from my mind:
PHP Code:
stock SendCloseMessage(playeridcolormessage[], Float:range 2.5) {
     new 
Float:xFloat:yFloat:z;
     
GetPlayerPos(playeridxyz);
     for(new 
targetid 0maxplayerid GetPlayerPoolSize(); targetid <= maxplayeridtargetid++)
          if(
IsPlayerConnected(targetid) && IsPlayerInRangeOfPoint(targetidrangexyz))
               
SendClientMessage(targetidcolormessage);

usage:
PHP Code:
CMD:me(playeridparams[]) {
     new 
action[144];
     if(!
sscanf(params"s[144]"action)) {
          new 
message[144], name[MAX_PLAYER_NAME];
          
GetPlayerName(playeridMAX_PLAYER_NAMEname);
          
format(message144"* %s %s"nameaction);
          
SendCloseMessage(playerid, -1message10);
     }
     else 
SendClientMessage(playerid, -1"Usage: /me action");
     return 
1;

Both of these was written in the browser. See how easy it is?
This is not what he asked for. He needed a message that changes its color along with the players' radius.


Re: What is the best "ProxDetector" for RP chat system - Sew_Sumi - 29.06.2017

Quote:
Originally Posted by ranme15
View Post
This is not what he asked for. He needed a message that changes its color along with the players' radius.
And that is EXACTLY what's "wrong" with so many "fixes" for this function.


So many simply do an abrupt "in range" check and display 0xFFFFFFFF, rather than edging it in, because really, when they 'made their "edit", AKA Hacked the shit out of someones code to seemingly "get it working", they didn't understand it enough to really appreciate what that function, in itself, did.

Sure, it checks the range to a person and displays the message for them, but it checked the range in stages, and changed the alpha in the same pass.

That example by Ziggi is a good one.