Raised This Month: $32 Target: $400
 8% 

GET STEAM_USER_NAME / ID / other


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Canfiax
Member
Join Date: Jun 2009
Old 06-12-2009 , 07:29   GET STEAM_USER_NAME / ID / other
Reply With Quote #1

Hi there,

I have thinked about some way, so people could sign up easy to our homepage, whitout going to our website www.united-gamers.net.

So now i found a way, and i am pretty sure it can be done.

First of all, in chat there whould come a message like:

[INFO] Say "/signup (password)" with out qoutes to join the community!
[INFO] Members get FREE VIP! (need action on website first)
[INFO] For more info visit: www.united-gamers.net

So as it says, u can just say etc: "/signup fred123321" to sign up. Then there would open up a MOTD called "signup.txt" with a iframe, wich could be done like this:

<iframe src="https://united-gamers.net/in_game_signup.php?username=STEAM_USER_NAME&s team_name=STEAM_USER_NAME&pass=GET_THE_TYPED_ PASS"></iframe>
<h2>Sign up complete!</h2>
You now joined www.united-gamers.net. Please put unG^ in your name now, and manage your profile/account at: www.united-gamers.net/community/login.php - thank you for joining!

I was woundering if someone could make this script for me prehabs? I know this is not a gift forum, but it would be nice if someone atleast could show me how to do that :-).

(I am allready a php-programmer, so i understand the most of the code in pawn, when i read).

Thank you, and have a nice day!
Canfiax is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 06-12-2009 , 15:21   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #2

Code:
#include <amxmodx> new g_Message[33] public plugin_init() {     register_plugin("Adverts","0.1a","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! (need action on website first)");     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=^"https://united-gamers.net/in_game_signup.php?username=%s&steam_name=%s&pass=%s^"></iframe>^n<h2>Sign up complete!</h2>",     Cache,Name,Pass);         show_motd(id,Cache);     return PLUGIN_HANDLED }
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Canfiax
Member
Join Date: Jun 2009
Old 06-12-2009 , 22:31   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #3

Man, u are the best.. I will test this now..

Does %ssteam_name%s automaticly gets the steam account name (that u login with)? And can it also get the STEAMID? like ?steamid=%ssteam_id%s Thank you man, u the best! ;)
Canfiax is offline
Canfiax
Member
Join Date: Jun 2009
Old 06-12-2009 , 22:54   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #4

Oh, working great, but almost :-).

Now the variable gets the steamid, thats great. But as i said before, can u get the steam_account_name? or atleast the ingamename? Like "SupERHeaDshoTtER1822" ? TY!
Canfiax is offline
Canfiax
Member
Join Date: Jun 2009
Old 06-12-2009 , 23:02   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #5

ah, i have a great idea. I dont know if it is something you mgith wanted to help me with, but i can only say, that it would be great. And im just really dont want my reputation to be like im just the little johnny who just can get the programmers to program him stuff.

But. Theres my list, of things. You can just work on it, if you think you got time and can handle it:

LIST OF GETS (from steam):
steam id (got it)
steam login-name
steam IN-GAME-NAME

To do after sucessfull signup:
Change nick (amx_nick command) and put unG^ in front of name automaticly.
Maybe shows a message like "LinkinBAC21 has joined United-Gamers.net - welcome!"
But isint really nessacary, but would be a nice thing.
____________________________

Thats it. I dont know if it is simple, or hard, but by from my PHP-Programmer
experience i wouldent say that this should be hard, if you know pawn well.

Thank you - have a nice night/morning :-).
Canfiax is offline
Canfiax
Member
Join Date: Jun 2009
Old 06-12-2009 , 23:07   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #6

Last edit from code:
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);
    
    show_motd(id,Cache);
    return PLUGIN_HANDLED
}

Last edited by Canfiax; 06-12-2009 at 23:24.
Canfiax is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-12-2009 , 23:28   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #7

Quote:
Originally Posted by Canfiax View Post
LIST OF GETS (from steam):
steam login-name
I sure hope you can't get that. I would consider that a breach of privacy.
__________________
fysiks is offline
Canfiax
Member
Join Date: Jun 2009
Old 06-12-2009 , 23:45   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #8

oh okay, yeah. I was thinking the same aswell, but i wasent sure, because if u can say "Add players you are currenltly playing with to friendlist" i thought that it wasent a problem tho. But thanks, but what about the other gets ? You think that is possible?
Canfiax is offline
Canfiax
Member
Join Date: Jun 2009
Old 06-12-2009 , 23:45   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #9

but what is the "command" / "variable" to catch in-game-name?
Canfiax is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-13-2009 , 01:29   Re: GET STEAM_USER_NAME / ID / other
Reply With Quote #10

The in-game name is already done for you (it's held by the variable "Name"). Line 58 retrieves the actual in-game name (as the function clearly says).

As it is you get this html:

Code:
<iframe src="https://united-gamers.net/in_game_signup.php?username=STEAM_ID_IS_HERE&steam_name=IN_GAME_NAME_IS_HERE&pass=PASSWORD_IS_HERE"></iframe>^n<h2>Sign up complete!</h2>
Also, there is no need to use an iframe. Just use only the URL.

As for the Steam login name, when you add friends you only see the Steam Friends name.
__________________

Last edited by fysiks; 06-13-2009 at 01:35.
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 22:46.


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