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

GET STEAM_USER_NAME / ID / other


Post New Thread Reply   
 
Thread Tools Display Modes
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-13-2009 , 06:13   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #11

How could i place a client_cmd ( id, "name unG^%s", name )? I mean, when he have registered
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.

Last edited by TitANious; 06-13-2009 at 06:17.
TitANious is offline
Send a message via MSN to TitANious
Canfiax
Member
Join Date: Jun 2009
Old 06-13-2009 , 07:15   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #12

Yes.. I've worked a little on the script with my friend, and we have now come a little bit future.

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]
    
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^" width=400 height=800></iframe>^n",
    
Cache,Name,Pass);
    
client_cmd id"name unG^%s"Name );
    
    
show_motd(id,Cache);
    return 
PLUGIN_HANDLED

But.. first of all, i wanted to change the name automaticly to put "unG^" in the name by client_cmd ( id, "name unG^%s", Name ); but the problem is that if my name is like "Jimmy" it changes to "unGJimmi". I really wanted to make it look like: "unG^ Jimmy" (make space and make a ^ wich it dosent). I tryed serval things, but it still dosent work. In PHP/HTML this would be quite simple (&nbsp; etc) but i dont know what to do in pawn.

And then second, i also wanted to print out the PLAYER NAME in the iframe, and i tryed to do this: &playername=%Name% and &playername%sName%s but dosent work any of them.. And when i use %sName%s the script dosent even work .. hehe.

So that should be the current 2 issues :-).

Cya guys, and thank you by now, for the help !
Canfiax is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-13-2009 , 13:46   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #13

Quote:
Originally Posted by Canfiax View Post
But.. first of all, i wanted to change the name automaticly to put "unG^" in the name by client_cmd ( id, "name unG^%s", Name ); but the problem is that if my name is like "Jimmy" it changes to "unGJimmi". I really wanted to make it look like: "unG^ Jimmy" (make space and make a ^ wich it dosent). I tryed serval things, but it still dosent work. In PHP/HTML this would be quite simple (&nbsp; etc) but i dont know what to do in pawn.
The ^ is the escape character like \ is in PHP. So you probably have to do ^^ to get a ^ printed to the string.

Code:
client_cmd ( id, "name unG^^ %s", Name )
Quote:
Originally Posted by Canfiax View Post
And then second, i also wanted to print out the PLAYER NAME in the iframe, and i tryed to do this: &playername=%Name% and &playername%sName%s but dosent work any of them.. And when i use %sName%s the script dosent even work .. hehe.
You don't understand how format works. It's similar to fprintf() or something like that. %s will input a string. There is no replacement of "%Name%".

Code:
format(variable, 63, "%s %s", "Hello", "World")
Now, the "variable" var will contain the string "Hello World".

Hope this helps, I will be on tomorrow if you need more help.
__________________
fysiks is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-13-2009 , 13:52   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #14

Thanks for your help Physic (Fysik)
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
Drak
Veteran Member
Join Date: Jul 2005
Old 06-13-2009 , 15:29   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #15

When you're setting a name, use "set_user_info".
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-13-2009 , 15:31   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #16

set_user_info ( id, "name", "unG^^%s", name );
?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
Drak
Veteran Member
Join Date: Jul 2005
Old 06-13-2009 , 17:18   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #17

Code:
new FName[46] get_user_name(id,FName,45); format(FName,45,"unG^^%s",FName); set_user_info(id,"name",FName);
The only reason why I suggest this, is because "client_cmd" is not as reliable.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Canfiax
Member
Join Date: Jun 2009
Old 06-13-2009 , 17:32   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #18

Oh, thanks guys for the answers.
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]
    
get_user_name(id,Name,32);
    
get_user_authid(id,Cache,255);

    new 
FName[46]
    
get_user_name(id,FName,45);

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

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

    
client_print 0print_chat"[INFO] %s has now joined United-Gamers.net"Name )

    
show_motd(id,Cache);
    return 
PLUGIN_HANDLED

So you should print the playername in the link by adding: &playername=%FName% ?.. :-).

Last edited by Canfiax; 06-13-2009 at 17:51.
Canfiax is offline
Canfiax
Member
Join Date: Jun 2009
Old 06-13-2009 , 17:33   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #19

And oh, how do you make space between unG^ and the players name?

Like unG^ test hehe.
*edit: Nevermind found out, just made a space lol.. But last when i did this, i got an erro (ofc because the system though it was a escape character.. Think it works now.. but im testing

Last edited by Canfiax; 06-13-2009 at 17:38.
Canfiax is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 06-13-2009 , 17:40   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #20

Replace the entire function with what i have.
Code:
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 }

The "unG^" won't be added to the MOTD/Website window.
(That's why set_user_info is AFTER the format of cache)
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
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 08:27.


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