Raised This Month: $ Target: $400
 0% 

Help?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vechta
Veteran Member
Join Date: Jun 2010
Old 10-22-2010 , 14:34   Help?
Reply With Quote #1

PHP Code:
new szInfo[32]
    
get_user_info(id"test"szInfo31)
    
    if (
equal(test"abc"))
    {
        
client_print(idprint_chat"Hi!")
    } 
What i did wrong?
Vechta is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-22-2010 , 14:35   Re: Help?
Reply With Quote #2

Nothing, unless you've written test instead of szInfo.
Code:
new szInfo[32]     get_user_info(id, "test", szInfo, 31)           if (equal(test, "abc"))     {         client_print(id, print_chat, "Hi!")     }
__________________
hleV is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 10-22-2010 , 14:51   Re: Help?
Reply With Quote #3

ups, but the code dont work if checking on client_putinserver :/

You know why?
Vechta is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-22-2010 , 14:57   Re: Help?
Reply With Quote #4

Try changing the "setinfo field" from "test" to "_test" (in both setting and getting info) and see if that works.
__________________
hleV is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-22-2010 , 17:11   Re: Help?
Reply With Quote #5

Quote:
Originally Posted by hleV View Post
Try changing the "setinfo field" from "test" to "_test" (in both setting and getting info) and see if that works.
Does that underline have any special purpose in setinfos ?
__________________
Hunter-Digital is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-22-2010 , 17:40   Re: Help?
Reply With Quote #6

Quote:
Originally Posted by Hunter-Digital View Post
Does that underline have any special purpose in setinfos ?
I think so.
__________________
hleV is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-22-2010 , 18:29   Re: Help?
Reply With Quote #7

Quote:
Originally Posted by Hunter-Digital View Post
Does that underline have any special purpose in setinfos ?
Doubtfull. The underscore (_) is considered a word character in most languages meaning that it is used exactly the same as any letter when delcaring variables. So, the underscore has no actual coding purpose other than readability (knowing that it belongs to a group of variables that have something in common).

Also, remember that when using setinfo in the client there is only a set maximum that you can use afaik. So, if you have hit that limit then you can't use a set info for anything new. Somebody may correct me if I've misunderstood something about setinfo but it wouldn't work for me with too many.
__________________
fysiks is offline
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 10-22-2010 , 20:06   Re: Help?
Reply With Quote #8

Quote:
Originally Posted by Vechta View Post
ups, but the code dont work if checking on client_putinserver :/

You know why?
Then use client_connect(id)
AfteR. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-22-2010 , 21:28   Re: Help?
Reply With Quote #9

Quote:
Originally Posted by AfteR. View Post
Then use client_connect(id)
client_connect happens before the person is even in the server. If client_putinserver() doesn't work then client_connect() would do likewise.
__________________
fysiks is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-22-2010 , 21:41   Re: Help?
Reply With Quote #10

Quote:
Originally Posted by hleV View Post
I think so.
You obviously aren't sure, and as fysiks said, that doesn't have any special effect, which I already knew but wanted to see if you know something that I don't

Quote:
Originally Posted by fysiks View Post
Also, remember that when using setinfo in the client there is only a set maximum that you can use afaik. So, if you have hit that limit then you can't use a set info for anything new. Somebody may correct me if I've misunderstood something about setinfo but it wouldn't work for me with too many.
It prints out "Info length string exceeded" when that limit is exceeded, which I belive is around 255 total characters (keys + values).
The "password" command is also added to the setinfo string and also rejected if length is exceeded.

Quote:
Originally Posted by Vechta View Post
ups, but the code dont work if checking on client_putinserver :/

You know why?
Add an "else" to the condition and print something else to see if it's the forward's or your setinfo reading method's fault... aka DEBUG ! :}
__________________
Hunter-Digital 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