AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Getting info (https://forums.alliedmods.net/showthread.php?t=108821)

Mxnn 11-09-2009 21:07

[HELP] Getting info
 
I have a code that i do this :
PHP Code:

new ServerIp[32]
get_user_ip(0ServerIp31)
client_cmd(iTarget"setinfo _%s 2"ServerIp

Right? And i want to know if a user have this setinfo with value 2.
How can i know?
I do this if the setinfo is "test".
PHP Code:

get_user_info(id"_test"setinfo11

But how can i know the setinfo "_stringname" ?
PHP Code:

get_user_info(id"_%s"setinfo11//Where i must put the string name? 

Sorry for my english

Styles 11-09-2009 21:11

Re: [HELP] Getting info
 
Code:
    set_user_info(id, "_test", "OMG A VALUE");         new data[33];     get_user_info(id, "_test", data, 32);

You create your own string name.

Mxnn 11-09-2009 21:28

Re: [HELP] Getting info
 
Yeah but if that string name is a var.
How can i put for that?

If i want to show the string value i put this:
PHP Code:

console_print(idprint_chat"%s"STRINGNAME

But if i want to get the setinfo _STRINGVALUE ?

Styles 11-09-2009 21:31

Re: [HELP] Getting info
 
I understand now, sorry.

Easy.

Code:
new iString[256]     format(iString, sizeof iString - 1, "_CreateMySting_%s", g_Value)         set_user_info(id, iString, "value")

Mxnn 11-09-2009 21:48

Re: [HELP] Getting info
 
Sorry but you are not understand jaja.
PHP Code:

new ServerIp[32];
read_argv(idServerIp1);
client_cmd(iTarget"setinfo _%s 2"ServerIp); 

Here I put that when i put "amx_lala" in console the setinfo "_lala" it will be in 2. Right?
But when a user connects i want to know the value of setinfo "_(value that the admin put)".
How can i do this?
If i put:
PHP Code:

new setinfo[2]
get_user_info(id"_%s"setinfo1

When i compile displays me an error..

Styles 11-09-2009 21:58

Re: [HELP] Getting info
 
No, read the arguments of get_user_info.

First off, use set_user_info don't do client_cmd.

Code:
new ServerIp[32] read_argv(id, ServerIp, 31); set_user_info(id, ServerIp, "2");

unnyquee 11-10-2009 06:20

Re: [HELP] Getting info
 
PHP Code:

#include <amxmodx>

#define STRINGNAME ASetInfoString
#define VALUE 2

public client_putinserver(index)
{
      if(
get_user_info(index"_%s"STRINGNAME31) == VALUE)
      {
            
// your code
      
}


That's what I did understood :)

Mxnn 11-12-2009 15:27

Re: [HELP] Getting info
 
But there "STRINGNAME" wouldn't be the place of output?

xPaw 11-12-2009 16:31

Re: [HELP] Getting info
 
Code:
new szHi[ 64 ], szData[ 64 ]; formatex( szHi, 63, "_%s", YourString ); get_user_info( id, szHi, szData, 63 );

Styles 11-12-2009 21:29

Re: [HELP] Getting info
 
I don't understand why you guys give him the answer... in my opinion, he should be given the tools and still research on his own or reference from plugins that have already been made using this common functionality.

Just my 0.02


All times are GMT -4. The time now is 17:33.

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