samisalreadytaken / vs_library

vscript library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Event player_connect can only get BOT Networkid

INoriEGOIST opened this issue · comments

commented

I try to use the eventlistener catch players info but
It seems only BOT player can correctly get the NetworkId and name,while mine is both null.
Is that because I'm running map on local server ?
Here's my consle screenshot
-37ff27a497d99ed1

commented

Here's my nut,i type this on my phone so maybe there will be some api name spill default,sry

IncludeScript("vs_library");
VS.ListenToGameEvent( "player_connect", function( event )
{
printl("Success get player");
print("Player NetworkId "+event.networkid);
print("Player userId "+event.userid);
print("Player name "+event.name);
}, "GetPlayerInfo");

This is mentioned in the readme under the "Use on dedicated servers" section. When the map is changed in a listen server using the console commands map or changelevel, the server is not shut down, you, the player is not disconnected, and thus the player does not fire the player_connect event. To prevent this you need to disconnect from your local server, then launch it again.

commented

Thanks a lot,it's seems i could only find another way to manage players info

After taking a second look I figured out a way to get Steam name and SteamIDs in listen servers. However the issue still exists on dedicated servers. Please try again using v2.43.0, and see if it works fine.