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(playerid, color, message[], Float:range = 2.5) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new targetid = 0, maxplayerid = GetPlayerPoolSize(); targetid <= maxplayerid; targetid++)
if(IsPlayerConnected(targetid) && IsPlayerInRangeOfPoint(targetid, range, x, y, z))
SendClientMessage(targetid, color, message);
}
usage:
PHP Code:
CMD:me(playerid, params[]) {
new action[144];
if(!sscanf(params, "s[144]", action)) {
new message[144], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, MAX_PLAYER_NAME, name);
format(message, 144, "* %s %s", name, action);
SendCloseMessage(playerid, -1, message, 10);
}
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
To be honest, why not create your own stock? It's too easy.
Here's something from my mind:
PHP Code:
stock SendCloseMessage(playerid, color, message[], Float:range = 2.5) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new targetid = 0, maxplayerid = GetPlayerPoolSize(); targetid <= maxplayerid; targetid++)
if(IsPlayerConnected(targetid) && IsPlayerInRangeOfPoint(targetid, range, x, y, z))
SendClientMessage(targetid, color, message);
}
usage:
PHP Code:
CMD:me(playerid, params[]) {
new action[144];
if(!sscanf(params, "s[144]", action)) {
new message[144], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, MAX_PLAYER_NAME, name);
format(message, 144, "* %s %s", name, action);
SendCloseMessage(playerid, -1, message, 10);
}
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
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.