Quote:
Originally Posted by vamppa
 thanks, so I can use static for getting steamid?
PHP Code:
static sCID[32];
public client_putinserver(id)
{
get_user_authid( id, sCID, 31 );
}
is it good to use on variables that dont get changed often? (mapname,hostname)
do statics get refreshed on map change?
|
Tip:
You should not use any static variables until we tell you that it is necessary.
Quote:
Originally Posted by vamppa
yeah your right about getting rid of the name but believe it or not for this mod its mainly used for easy reference to know who the person is. we are a small community that know eachother by their registered names. just putting an easy face behind the steamid if the name is correct.
otherwise we look up their steamid in our database, it saves a lot of time if we dont always have to do this. I do have concerns about it not working propperly on One idea I have in mind but not yet started working on, so will see : )
|
You have flawed logic. What if a person joins the server with the name "asdf" and then changes it to their real name (the name that you know) half way through the map? Your messages will say "asdf" and then everybody will be thinking "who is 'asdf'?".
Quote:
Originally Posted by vamppa
ok I'll take your word for it but am curious as to why? is it an cpu consuming method ?
which wouldn't make sense as it sounds like thats what the method is trying to avoid.
|
Because 1) it is unnecessary to cache the names and 2) you will not be able to comprehend it, IMO (and I don't feel like re-learning how to do it).
Quote:
Originally Posted by vamppa
could you give me an example of how to cache getting steamid ?
am pretty new to this and want to learn.
|
Code:
new g_szSteamIDs[33][30];
// . . .
public client_authorized(id)
{
get_user_authid(id, g_szSteamIDs[id], charsmax(g_szSteamIDs[]));
}
__________________