Raised This Month: $ Target: $400
 0% 

client_putinserver


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mwebmedia
New Member
Join Date: Jul 2011
Old 07-20-2011 , 23:57   client_putinserver
Reply With Quote #1

hey guys,
have an small question about an small plugin. Dont blame me, im a new coder

i only want to show, steamid and name

Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "connect"
#define AUTHOR    "mwebmedia"
#define VERSION    "1.0"

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
}

public client_putinserver(id) {
    new name[18]
    new userid[18]
        get_user_authid(id, userid, 17)
    get_user_name(id, name, 17)
    client_print(0, print_chat, "%s %d", userid, name);
    return PLUGIN_CONTINUE    
}
but it only shows the steamid and not the name, why?

Last edited by mwebmedia; 07-21-2011 at 00:23.
mwebmedia is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-21-2011 , 00:26   Re: client_putinserver
Reply With Quote #2

They are both strings, so you have to use %s for both.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-21-2011 , 02:27   Re: client_putinserver
Reply With Quote #3

new name[33]
new userid[18]
get_user_authid(id, userid, 17)
get_user_name(id, name, 32)
client_print(0, print_chat, "%s %s", userid, name);
return PLUGIN_CONTINUE

change the above lines
gamer99 is offline
mwebmedia
New Member
Join Date: Jul 2011
Old 07-21-2011 , 17:34   Re: client_putinserver
Reply With Quote #4

Okay thanks!
But can you tell me, why get_user_authid(id, userid, 17) sometimes dont post an steamid? at some people/sometimes its zero or a random number like 83 :/
mwebmedia is offline
Honors
Member
Join Date: Jul 2011
Old 07-21-2011 , 17:37   Re: client_putinserver
Reply With Quote #5

An AuthID has 34 characters, so -> new userid[ 35 ]

PS : Use the native charsmax( )

Code:
get_user_authid( id , userid , charsmax( userid ) )
Honors is offline
mwebmedia
New Member
Join Date: Jul 2011
Old 07-21-2011 , 17:48   Re: client_putinserver
Reply With Quote #6

Quote:
Originally Posted by Honors View Post
An AuthID has 34 characters, so -> new userid[ 35 ]

PS : Use the native charsmax( )

Code:
get_user_authid( id , userid , charsmax( userid ) )
This Forum is so awesome! thanks for your help
So if I want to run an function of mine, only if one user connected, I musst do it with set_task in public client_putinserver()?
mwebmedia is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-21-2011 , 18:33   Re: client_putinserver
Reply With Quote #7

Quote:
Originally Posted by mwebmedia View Post
So if I want to run an function of mine, only if one user connected, I musst do it with set_task in public client_putinserver()?
What exactly do you mean? Generally, you do not need to use a set task unless you need something delayed. So, it really depends on what you are trying to do.
__________________
fysiks is offline
Honors
Member
Join Date: Jul 2011
Old 07-21-2011 , 18:49   Re: client_putinserver
Reply With Quote #8

If I have understood, you can do this :

Code:
public function( id ) {      new players[ 32 ] , num , i , id      get_players( players , num , "ch" )      if( num >= 1 )      {           // stuff ...      } }

Last edited by Honors; 07-21-2011 at 21:02.
Honors 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 01:09.


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