
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?
Quote:
|
Getting the name when you need it is usually done because it makes sense. If, for some odd reason, you don't care if the name is correct then you can cache it (if you don't care about the accurateness of the name then you should just get rid of it entirely, IMO). Also, depending on how you use the name, it might not work if it's not up-to-date.
|
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 : )
Quote:
|
There are ways to cache and keep names up-to-date but I would not recommend them for you.
|
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.
could you give me an example of how to cache getting steamid ?
am pretty new to this and want to learn.