Raised This Month: $51 Target: $400
 12% 

GET STEAM_USER_NAME / ID / other


Post New Thread Reply   
 
Thread Tools Display Modes
Canfiax
Member
Join Date: Jun 2009
Old 06-13-2009 , 17:58   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #21

Hii! And thank you for your answer.

But now anything dosent happend when u write /signup password.. But the [info] text is written, and the plugin is OK.

PHP Code:
#include <amxmodx>

new g_Message[33]

public 
plugin_init()
{
    
register_plugin("Signup plugin","0.2a","Drak");
    
register_event("ResetHUD","EventResetHUD","b");
    
    
// Commands
    
register_clcmd("say","CmdSay");
}

public 
client_disconnect(id)
    
g_Message[id] = 0

public EventResetHUD(const id)
    if(!
g_Message[id])
        
set_task(1.5,"ShowMessage",id);

/*==================================================================================================================================================*/
public ShowMessage(const id)
{
    if(!
is_user_alive(id))
        return
    
    
client_print(id,print_chat,"[INFO] Say ^"/signup (password)^" without quotes to join the community!");
    
client_print(id,print_chat,"[INFO] Members get FREE VIP! (no action needed)");
    
client_print(id,print_chat,"[INFO] For more info visit: www.united-gamers.net");
    
    
g_Message[id] = 1
}
/*==================================================================================================================================================*/
public CmdSay(const id)
{
    static 
Cache[256]
    
read_args(Cache,255);
    
    
remove_quotes(Cache);
    
trim(Cache);
    
    if(!
Cache[0])
        return 
PLUGIN_CONTINUE
    
    
if(!equali(Cache,"/signup ",8))
        return 
PLUGIN_CONTINUE
    
    
new Pass[33]
    
parse(Cache,Cache,1,Pass,32);
    
    if(!
Pass[0])
    {
        
client_print(id,print_chat,"[INFO] Usage: /signup <password>");
        return 
PLUGIN_HANDLED
    
}
    
    new 
Name[33],FName[46]
    
get_user_name(id,Name,32);
    
get_user_authid(id,Cache,255);   

    
format(Cache,255,"<iframe src=^"http://united-gamers.net/in_game_signup.php?username=%s&steam_name=%s&pass=%s&playername=%s^" width=400 height=800></iframe>^n",
    
Cache,FName,Pass);

    
formatex(FName,45,"unG^^ %s",Name);
    
set_user_info(id,"name",FName); 

    
show_motd(id,Cache);
    return 
PLUGIN_HANDLED

Canfiax is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-13-2009 , 23:43   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #22

Quote:
Originally Posted by Drak View Post
When you're setting a name, use "set_user_info".
The reason I use the client command in this case is that if you sign up you presumably want the tag on your name so with set_user_info() you only set the name in-game. When they leave and come back they won't have the tag. Of course if the person is smart they will have their cfg write protect already which means both methods will be equivalent.
__________________
fysiks is offline
Canfiax
Member
Join Date: Jun 2009
Old 06-14-2009 , 06:43   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #23

aha, yeah, i found out. That is somehow pretty annoying.. So do you want me to use client_cmd ( id, "name unG^^ %s", Name ); ? And then it will work or what? Because the error atm. is that nothing happens when u say "/signup password".. FULL CODE:

PHP Code:
#include <amxmodx>

new g_Message[33]

public 
plugin_init()
{
    
register_plugin("Signup plugin","0.2a","Drak");
    
register_event("ResetHUD","EventResetHUD","b");
    
    
// Commands
    
register_clcmd("say","CmdSay");
}

public 
client_disconnect(id)
    
g_Message[id] = 0

public EventResetHUD(const id)
    if(!
g_Message[id])
        
set_task(1.5,"ShowMessage",id);

/*==================================================================================================================================================*/
public ShowMessage(const id)
{
    if(!
is_user_alive(id))
        return
    
    
client_print(id,print_chat,"[INFO] Say ^"/signup (password)^" without quotes to join the community!");
    
client_print(id,print_chat,"[INFO] Members get FREE VIP! (no action needed)");
    
client_print(id,print_chat,"[INFO] For more info visit: www.united-gamers.net");
    
    
g_Message[id] = 1
}
/*==================================================================================================================================================*/
public CmdSay(const id)
{
    static 
Cache[256]
    
read_args(Cache,255);
    
    
remove_quotes(Cache);
    
trim(Cache);
    
    if(!
Cache[0])
        return 
PLUGIN_CONTINUE
    
    
if(!equali(Cache,"/signup ",8))
        return 
PLUGIN_CONTINUE
    
    
new Pass[33]
    
parse(Cache,Cache,1,Pass,32);
    
    if(!
Pass[0])
    {
        
client_print(id,print_chat,"[INFO] Usage: /signup <password>");
        return 
PLUGIN_HANDLED
    
}
    
    new 
Name[33],FName[46]
    
get_user_name(id,Name,32);
    
get_user_authid(id,Cache,255);   

    
format(Cache,255,"<iframe src=^"http://united-gamers.net/in_game_signup.php?username=%s&steam_name=%s&pass=%s&playername=%s^" width=400 height=800></iframe>^n",
    
Cache,FName,Pass);

    
formatex(FName,45,"unG^^ %s",Name);
    
set_user_info(id,"name",FName); 
        
client_cmd id"name"FName );

    
show_motd(id,Cache);
    return 
PLUGIN_HANDLED

and then just remove set user info?
Canfiax is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-14-2009 , 13:16   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #24

You can do whatever you want. I was just voicing my opinion on whether or not to change it client side. Don't do both. One or the other.
__________________
fysiks is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 06-14-2009 , 13:17   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #25

Check the server's console. You're probably getting errors.
Change this line to what I have.
Code:
    format(Cache,255,"<iframe src=^"http://united-gamers.net/in_game_signup.php?username=%s&steam_name=%s&pass=%s&playername=%s^" width=400 height=800></iframe>^n",     Cache,Name,Pass);
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Canfiax
Member
Join Date: Jun 2009
Old 06-14-2009 , 15:18   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #26

Hi Drak!
It says error when i try to compile.

PHP Code:
#include <amxmodx>

new g_Message[33]

public 
plugin_init()
{
    
register_plugin("Signup plugin","0.2a","Drak");
    
register_event("ResetHUD","EventResetHUD","b");
    
    
// Commands
    
register_clcmd("say","CmdSay");
}

public 
client_disconnect(id)
    
g_Message[id] = 0

public EventResetHUD(const id)
    if(!
g_Message[id])
        
set_task(1.5,"ShowMessage",id);

/*==================================================================================================================================================*/
public ShowMessage(const id)
{
    if(!
is_user_alive(id))
        return
    
    
client_print(id,print_chat,"[INFO] Say ^"/signup (password)^" without quotes to join the community!");
    
client_print(id,print_chat,"[INFO] Members get FREE VIP! (no action needed)");
    
client_print(id,print_chat,"[INFO] For more info visit: www.united-gamers.net");
    
    
g_Message[id] = 1
}
/*==================================================================================================================================================*/
public CmdSay(const id)
{
    static 
Cache[256]
    
read_args(Cache,255);
    
    
remove_quotes(Cache);
    
trim(Cache);
    
    if(!
Cache[0])
        return 
PLUGIN_CONTINUE
    
    
if(!equali(Cache,"/signup ",8))
        return 
PLUGIN_CONTINUE
    
    
new Pass[33]
    
parse(Cache,Cache,1,Pass,32);
    
    if(!
Pass[0])
    {
        
client_print(id,print_chat,"[INFO] Usage: /signup <password>");
        return 
PLUGIN_HANDLED
    
}
    
    new 
Name[33],FName[46]
    
get_user_name(id,Name,32);
    
get_user_authid(id,Cache,255);   

    
format(Cache,255,"<iframe src=^"http://united-gamers.net/in_game_signup.php?username=%s&steam_name=%s&pass=%s&playername=%s^" width=400 height=800></iframe>^n",
    
Cache,FName,Pass);

    
formatex(Name,45,"unG^^ %s",Name);
    
set_user_info(id,"name",FName); 

    
show_motd(id,Cache);
    return 
PLUGIN_HANDLED

Your plugin failed to compile! Read the errors below:

But no errors are shown..? TY
Canfiax is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 06-14-2009 , 16:17   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #27

It compiles fine for me. Don't use the web compiler.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-14-2009 , 16:21   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #28

Here is it compiled
Attached Files
File Type: sma Get Plugin or Get Source (Signup.sma - 352 views - 1.8 KB)
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-14-2009 , 16:31   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #29

@Canfiax: It seems that the webcompiler is not working correctly right now. (Although, it works for my plugin in my signature, strange).

Quote:
Originally Posted by TitANious View Post
Here is it compiled
FYI, .sma posted on the forum uses the same webcompiler. And therefore, will not compile if you attache the sma to your post.
__________________
fysiks is offline
Old 06-14-2009, 16:37
TitANious
This message has been deleted by TitANious. Reason: Compiled plugin
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-14-2009 , 16:38   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #30

You should try to compile locally.
__________________

Last edited by fysiks; 06-14-2009 at 16:42.
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 05:54.


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