AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   setinfo help (https://forums.alliedmods.net/showthread.php?t=220321)

connoisseur 07-09-2013 13:12

setinfo help
 
Following are a few lines from my code:
PHP Code:

new var[32]
format (var, 31"blabla")
set_user_info (id"var" , var) 

The program compiles with no error.
But the setinfo does not work while running the plugin.
I have to manually put "setinfo var blabla" in console.

Does the set_user_info not take variables in its arguments?
The variable var does not remain the same in the code, so I cannot use
PHP Code:

set_user_info (id"var" "blabla"

Any suggestions?

ChileScripting 07-09-2013 20:23

Re: setinfo help
 
Test:

Code:
    new var[32]     formatex(var, charsmax(var), "blabla")     set_user_info(id, "var %s" , var)

fysiks 07-09-2013 21:14

Re: setinfo help
 
You are using the function correctly. set_user_info() sets a user's info on the server. What variable are you trying to set and what are you expecting to happen?


Quote:

Originally Posted by ChileScripting (Post 1987300)
Test:

Code:
    new var[32]     formatex(var, charsmax(var), "blabla")     set_user_info(id, "var %s" , var)

No.

connoisseur 07-10-2013 03:40

Re: setinfo help
 
Quote:

Originally Posted by fysiks (Post 1987323)
What variable are you trying to set and what are you expecting to happen?

Code:

setinfo var <information>
I'm trying to put the value of var[32] in <information>
But it is not working, I have to manually put "setinfo var <information>" in the client console, while testing.

Shooting King 07-10-2013 04:20

Re: setinfo help
 
Use this.

PHP Code:

client_cmdid "setinfo var %s", var ) 


EpicMonkey 07-10-2013 05:24

Re: setinfo help
 
Quote:

Originally Posted by Shooting King (Post 1987471)
Use this.

PHP Code:

client_cmdid "setinfo var %s", var ) 


No! :3

connoisseur 07-10-2013 06:12

Re: setinfo help
 
Quote:

Originally Posted by Shooting King (Post 1987471)
Use this.
PHP Code:

client_cmdid "setinfo var %s", var ) 


Are you sure this will work in accordance with the new steam update restrictions?

.Dare Devil. 07-10-2013 06:17

Re: setinfo help
 
PHP Code:

static key[8], value[16]
formatkeycharsmax(key), "_key" )
formatvaluecharsmax(value), "mycostomvalue" )
set_user_info idkeyvalue 

PHP Code:

or
set_user_info id"_key""mycostomvalue" 


fysiks 07-10-2013 14:59

Re: setinfo help
 
Quote:

Originally Posted by connoisseur (Post 1987458)
Code:

setinfo var <information>
I'm trying to put the value of var[32] in <information>
But it is not working, I have to manually put "setinfo var <information>" in the client console, while testing.

You need to explain what you are trying to do. Just saying "I'm trying to put info in a variable" is not helpful.

Shooting King 07-11-2013 01:05

Re: setinfo help
 
Quote:

Originally Posted by connoisseur (Post 1987522)
Are you sure this will work in accordance with the new steam update restrictions?

Try it .


All times are GMT -4. The time now is 06:31.

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