birjj / csgo-vscripts

Various vscripts for CS:GO I have written

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FindByUserid function not working

zurgerking091 opened this issue · comments

I've been working on trying to get this function to work for awhile now and still can't get it to work,
After passing userid from player_hurt, which seems to work, I get all the players and bots in the game and their scopes, but after lots of debugging I found out that this is the problem
if (("userid" in scope) && scope.userid == userid) { return ent; }
Neither of the statements passed through this if statement are true.

Sounds like the user IDs are never being collected. Have you followed the instructions in the comment at the top of players.nut and added an event listener for player_use? If you change Log to printl in this line do you start seeing the message "[Players] Got player ... for userid ..." in console when a new player joins?