ProxDetector
#1

I've been told that ProxDetector is an old and outdated function. Ah well, my question is, what should I use instead? I haven't been scripting for too long and I have to know what is the best way to check if the player is in a given range to see another player's sent message. I'm expecting replies from known, talented scripters.
Reply
#2

I use IsPlayerInRangeOfPoint(Float:range,Float,Float:y ,Float:z)
But can't really say whether its optimal, it works fine tho.
Reply
#3

Other answers?
Reply
#4

Quote:
Originally Posted by Denis1
Посмотреть сообщение
Other answers?
Well, yeah you should use IsPlayerInRangeOfPoint

Quote:
Originally Posted by Denis1
Посмотреть сообщение
and I have to know what is the best way to check if the player is in a given range to see another player's sent message
You can youse this function:

Код:
stock SendRangeMessage(playerid,color,Float:range,const string[]) {
    new Float:p[3],i;
    GetPlayerPos(playerid,p[0],p[1],p[2]);
    for(;i<MAX_PLAYERS; i++) if(IsPlayerInRangeOfPoint(i,range,p[0],p[1],p[2])) SendClientMessage(i,color,string);
    return 1;
}

//Example:
SendRangeMessage(playerid,-1,15.0,"Hallo"); //Sends a Message to all players in a range of 15.0
Greekz
Reply
#5

Thanks for your answer, Kaliber. I have just given you a reputation point.
Reply
#6

Plainly using IsPlayerInRangeOfPoint will send messages through virtualworlds, making businesses and houses pretty glitchy if they use the same interior though.
I don't see anything wrong in using ProxDetector, it works just fine.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)