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