Raised This Month: $ Target: $400
 0% 

Question about stats and retrieving steamID (edited)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-08-2008 , 22:03   Question about stats and retrieving steamID (edited)
Reply With Quote #1

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?
__________________

Last edited by Bugsy; 02-09-2008 at 01:46.
Bugsy is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 02-08-2008 , 22:35   Re: Safe (connect) time when players authid is definitely retrievable
Reply With Quote #2

You are correct in assuming to use client_authorized. Authorized is called after their STEAM_ID is retrieved from the steam servers.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-09-2008 , 01:42   Re: Safe time when players authid is definitely retrievable, & stats problem
Reply With Quote #3

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:
public client_authorized(id) {     set_task(10.0,"client_authorized_2", id); } public client_authorized_2(id) {        //code }
__________________

Last edited by Bugsy; 02-09-2008 at 01:47.
Bugsy is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 02-09-2008 , 01:55   Re: Question about stats and retrieving steamID (edited)
Reply With Quote #4

That's fine to do, and no, one set_task is not going to affect the speed or stability of your plugin.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
oRNY
Member
Join Date: Feb 2008
Location: Israel
Old 02-09-2008 , 08:52   Re: Question about stats and retrieving steamID (edited)
Reply With Quote #5

What's wrong with client_connect(id) ?
oRNY is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-09-2008 , 12:21   Re: Question about stats and retrieving steamID (edited)
Reply With Quote #6

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.
__________________
Bugsy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode