Question about stats and retrieving steamID (edited)
Edit: Scroll down to my 2nd post
My plugin has to read a vault entry for a player (using the players SteamID) when they first connect. Will client_authorized be a 100% safe time to retrieve a players SteamID? I believe in the past I have used it but sometimes STEAM_ID_PENDING would come back (I think, it may have been client_connect). Currently I am using an event that calls my function on player spawn but I figured this is too repetitive for something that only needs to be read once per connection to the server. Anyone have a recommendation? |
Re: Safe (connect) time when players authid is definitely retrievable
You are correct in assuming to use client_authorized. Authorized is called after their STEAM_ID is retrieved from the steam servers.
|
Re: Safe time when players authid is definitely retrievable, & stats problem
Now.. that works good but now I remember why I made the function at spawn and not client_authorized.
At the users first connection, the plugin saves the players kills+deaths to the vault but at client_authorized, stats are not yet able to be read (for some reason). When get_user_stats is called, it returns 0 for everything. Everything being returned rank position, and every element of stats[] and bodyhits[]. When called at spawn or round_start everything works fine. Does anyone have a solution that can handle both of my problems at once? Summary of what I need: When a player joins server, doesn't matter if it is instantly or not. It just has to happen at some point in time when a player joins. I need to be able to read a players stats and be able to retrieve their steamID. I was able to fix it by doing the following but is it safe doing it this way? (stability, memory usage) Code:
|
Re: Question about stats and retrieving steamID (edited)
That's fine to do, and no, one set_task is not going to affect the speed or stability of your plugin.
|
Re: Question about stats and retrieving steamID (edited)
What's wrong with client_connect(id) ?
|
Re: Question about stats and retrieving steamID (edited)
I don't think the user has yet validated their SteamID at that time, that's why client_authorized is preferable. And for reading stats, I'm not able to successfully read stats at client_connect or client_authorized. Try it you will see.
|
All times are GMT -4. The time now is 16:59. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.