Raised This Month: $ Target: $400
 0% 

[HELP] Getting info


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 11-09-2009 , 21:07   [HELP] Getting info
Reply With Quote #1

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
Mxnn is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-09-2009 , 21:11   Re: [HELP] Getting info
Reply With Quote #2

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.
Styles is offline
Send a message via AIM to Styles
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 11-09-2009 , 21:28   Re: [HELP] Getting info
Reply With Quote #3

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 ?
Mxnn is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-09-2009 , 21:31   Re: [HELP] Getting info
Reply With Quote #4

I understand now, sorry.

Easy.

Code:
new iString[256]     format(iString, sizeof iString - 1, "_CreateMySting_%s", g_Value)         set_user_info(id, iString, "value")
Styles is offline
Send a message via AIM to Styles
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 11-09-2009 , 21:48   Re: [HELP] Getting info
Reply With Quote #5

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..
Mxnn is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-09-2009 , 21:58   Re: [HELP] Getting info
Reply With Quote #6

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");
Styles is offline
Send a message via AIM to Styles
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 11-10-2009 , 06:20   Re: [HELP] Getting info
Reply With Quote #7

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
__________________

Last edited by unnyquee; 11-10-2009 at 06:22.
unnyquee is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 11-12-2009 , 15:27   Re: [HELP] Getting info
Reply With Quote #8

But there "STRINGNAME" wouldn't be the place of output?
Mxnn is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-12-2009 , 16:31   Re: [HELP] Getting info
Reply With Quote #9

Code:
new szHi[ 64 ], szData[ 64 ]; formatex( szHi, 63, "_%s", YourString ); get_user_info( id, szHi, szData, 63 );
__________________
xPaw is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-12-2009 , 21:29   Re: [HELP] Getting info
Reply With Quote #10

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
Styles is offline
Send a message via AIM to Styles
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 17:33.


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