ProxDetector problem
#1

Well, i put in my script "famous" proxdetector for ranged IC Chat..

Код:
// proxdetector
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);
	    }
    }
}
but it doesn't work... again we see messages all over server
Reply
#2

PHP код:
foreach(new i:Player
Reply
#3

Quote:
Originally Posted by Argument
Посмотреть сообщение
PHP код:
foreach(new i:Player
He can do that if he has the old standalone version
Код:
Deprecation
The "foreach (Player, i)" syntax, which was deprecated YEARS ago now gives a warning when used. The warning contains the text "using_deprecated_foreach_syntax". This is the only change that will affect regular users, which is why I made it non-breaking.
I'd suggest to print what the radius equals to.
Reply
#4

I have new version of foreach...

so how to resolve this problem
Reply
#5

I already wrote and Arguement has wrote the correct syntax for the newest version.

If you're not receiving "using_deprecated_foreach_syntax" error, then it might be that you're not using the latest.


If you use YSI
https://sampforum.blast.hk/showthread.php?tid=571159
if you don't
https://sampforum.blast.hk/showthread.php?tid=570868

then use the code that Arguement wrote, and if it still doesn't work
Quote:

print what the radius equals to.

if the radius is crazy then the radius is the fault.
Reply
#6

not foreach
PHP код:
for(new ip_max GetPlayerPoolSize(); i<= p_maxi++) 
Reply
#7

Код:
// proxdetector
stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(new i:Player)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
	    }
    }
}
... with updated new foreach 0.4.3

still doesn't work
Reply
#8

Just going to mention, pretty sure this is a gutted out 'fixed' version of ProxDetector.

'Legendary' script had more than this, and more functionality.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)