On the GF client.
I'm trying to read if there are players around me with this code:
Code:
import chr,time,thread,chat,threading
start_time = time.time()
def isInstance(vid):
if chr.HasInstance(vid):
return True
return False
def isSelf(vid):
if chr.GetNameByVID(vid) == chr.GetName():
return True
return False
def isPlayer(vid):
if isInstance(vid):
if chr.GetInstanceType(vid) == chr.INSTANCE_TYPE_PLAYER:
return True
return False
def SCAN():
playerlist = []
for x in xrange(10000000):
if isInstance(x) and isPlayer(x) and not isSelf(x) and not x in playerlist:
playerlist.append(x)
return playerlist
def f1():
PLRS = SCAN()
chat.AppendChat(3, "Scan finished. {} players found.".format(len(PLRS)))
chat.AppendChat(2, "Took {}.".format(time.time()-begin))
t1 = threading.Thread(name='SCAN', target=f1)
t1.start()
t1.join()
I don't know why. And do you think this is the best method to do it? I couldn't find any functions to list players around me so I'm scanning for every possible VID number.
If anyone can give me some light





