Raised This Month: $ Target: $400
 0% 

get_user_info problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sader
Junior Member
Join Date: Aug 2011
Old 11-17-2011 , 20:00   get_user_info problem
Reply With Quote #1

Hi
I am trying to get client var value, but it looks so that if user is working on 64bit OS it doesn't work. I know that command client_cmd(id, "setinfo var value") works, cuz after I exit CS game I see that line in config.cfg, but still next time 64bit user connects to servers get_user_info() return empty value.

Here's my code prototype (btw client_connect doesn't return nor PLUGIN_CONTINUE nor PLUGIN_HANDLED, I'm not sure how to use those return constants properly)
PHP Code:
public client_connect(id)
{
  new 
val[33];
  
get_user_info(id"_myvarname"valcharsmax(val));
  
  
//if client doesn't have this var set yet then we will set it automaticly for him
  
if(val[0] == 0)
  {
    
client_cmd(id"setinfo ^"%s^" ^"%s^"""_myvarname"val); 
  }

And just in case. Cause may not be even 64bit OS ,but since I tested it on 2 different PC's 32 & 64 bits it was only idea I could come up with
sader is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-18-2011 , 00:13   Re: get_user_info problem
Reply With Quote #2

1. You probably can't send or send client info/commands on client_connect().
2. You shouldn't be changing people's settings. Stuff like that is not allowed here.
3. Explain what you are trying to do and we can likely suggest a better solution.
__________________

Last edited by fysiks; 11-18-2011 at 00:20.
fysiks is offline
sader
Junior Member
Join Date: Aug 2011
Old 11-18-2011 , 07:05   Re: get_user_info problem
Reply With Quote #3

I'm trying to generate uniqe ID for user and store it on clients config.cfg, so next time he logs in I check if player already has an ID if he doens't then new ID is generated.
sader is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-18-2011 , 11:16   Re: get_user_info problem
Reply With Quote #4

When you set the info to val, val[0] == 0 so you just set nothing.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sader
Junior Member
Join Date: Aug 2011
Old 11-18-2011 , 13:56   Re: get_user_info problem
Reply With Quote #5

PHP Code:
if(val[0] == 0
is the way I check if cl_varaiable exists and value is not "". I am not sure what would be right way to do it, but I can't find function such if_client_var_exists()
sader is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-18-2011 , 14:14   Re: get_user_info problem
Reply With Quote #6

You check val[0] == 0
If the check is passed it means that the info is not set on client.
Then you set it to val, but you have just check that val doesn't contain anything, you should make another variable to hold the default value you want to set in case the info is not already set.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-18-2011 , 15:48   Re: get_user_info problem
Reply With Quote #7

Is there a reason you can't just get their SteamID?
__________________
fysiks 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 08:32.


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