Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   tesplayer() (https://forums.graalonline.com/forums/showthread.php?t=134260986)

MrOmega 11-02-2010 06:40 PM

tesplayer()
 
Well, I'm testing for players serverside and testplayers just returns -2, and by accident I put testplayers() and it returned properly but I got the error "Function testplayers not found at line 191", now how can it return something if it doesnt exist?

xXziroXx 11-02-2010 06:42 PM

Quote:

Originally Posted by MrOmega (Post 1609774)
Well, I'm testing for players serverside and testplayers just returns -2, and by accident I put testplayers() and it returned properly but I got the error "Function testplayers not found at line 191", now how can it return something if it doesnt exist?

What -did- it return, and can you show the example code?

MrOmega 11-02-2010 06:46 PM

I echoed this and it was NULL
PHP Code:

playerstestplayerparams0], params1])].account 

then I did
PHP Code:

playerstestplayersparams0], params1])].account 

and it echoed my account, along with my other account
( I had both logged on, close together, this is in a loop, I'm using findnearestplayers now btw)

salesman 11-02-2010 11:05 PM

Are you testing it in a pk zone? I haven't tried to use this in a while, but I remember testplayer() only working in pk zones.

If you want to find a player in a non-pk zone, you need to use findNearestPlayers().

DrakilorP2P 11-02-2010 11:18 PM

Quote:

Originally Posted by MrOmega (Post 1609778)
I echoed this and it was NULL
PHP Code:

playerstestplayerparams0], params1])].account 

then I did
PHP Code:

playerstestplayersparams0], params1])].account 

and it echoed my account, along with my other account
( I had both logged on, close together, this is in a loop, I'm using findnearestplayers now btw)

Could it be that 'testplayers' didn't exist so it defaulted to 0 and the line returned the first player in the array?

Crow 11-02-2010 11:20 PM

Quote:

Originally Posted by DrakilorP2P (Post 1609820)
Could it be that 'testplayers' didn't exist so it defaulted to 0 and the line returned the first player in the array?

Pretty sure it did just that.

MrOmega 11-03-2010 12:27 AM

Quote:

Originally Posted by Crow (Post 1609821)
Pretty sure it did just that.

but returns a list containing both of my accounts...

Twinny 11-03-2010 11:41 PM

testplayers only returns players that are blocking as I remember so it's useless in nopk zones


All times are GMT +2. The time now is 12:17 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.