AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Steam id poster (https://forums.alliedmods.net/showthread.php?t=95684)

usabrad86 06-26-2009 05:39

Steam id poster
 
i think im almost there, just can get the userid to print

the tested output is

PHP Code:

Player()  has Left the server

has joined the server didnt even show

output I wanted is
PHP Code:

[IDPlayer(STEAM_0:0:1234has Joined the server.
[
IDPlayer(STEAM_0:0:1234has Left the server

and the code i make/used
PHP Code:

#include <amxmodx>
#include <amxmisc>

stock header[] = "[ID]"

public client_connect(id) {
    new 
userid get_user_userid(id)
    new 
name[32]
    
get_user_info(id"name"name31)
    
client_print(0,print_chat,"%s %s(%s) has Joined the server."headernameuserid);
}

public 
client_disconnect(id) {
    new 
userid get_user_userid(id)
    new 
name[32]
    
get_user_info(id"name"name31
    
client_print(0,print_chat,"%s %s(%s) has Left the server."headernameuserid);



DA 06-26-2009 05:45

Re: Steam id poster
 
Code:
new userid = get_user_userid(id)

should be

Code:
new userid[] = get_user_userid(id)

Xellath 06-26-2009 05:50

Re: Steam id poster
 
PHP Code:

#include <amxmodx>
 
#define PREFIX "[ID]"
 
public plugin_init()
{
    
register_plugin("Connect Message""0.1""usabrad86");
}
 
public 
client_connect(id
{
    new 
name[32], authid[32];
    
get_user_name(idname31);
    
get_user_authid(idauthid31);
    
client_print(0print_chat"%s %s(%s) has Joined the server."PREFIXnameauthid);
}
 
public 
client_disconnect(id
{
    new 
name[32], authid[32];
    
get_user_name(idname31);
    
get_user_authid(idauthid31); 
    
client_print(0print_chat"%s %s(%s) has Left the server."PREFIXnameauthid);



fysiks 06-26-2009 18:46

Re: Steam id poster
 
Instead of Define or stock, use:

PHP Code:

new const header[] = "[ID]" 


usabrad86 06-29-2009 03:19

Re: Steam id poster
 
trying to make it print all when i type amx_steamids :(

PHP Code:

#include <amxmodx>
 
new const header[] = "[ID]" 
 
public plugin_init()
{
    
register_plugin("Connect Message""0.1""usabrad86");
    
register_concmd("amx_steamids","postnow",ADMIN_KICK,"Show all steam ids"
}
 
public 
client_connect(id
{
    new 
name[32], authid[32];
    
get_user_name(idname31);
    
get_user_authid(idauthid31);
    
client_print(0print_chat"%s %s(%s) has Joined the server."headernameauthid);
}
 
public 
client_disconnect(id
{
    new 
name[32], authid[32];
    
get_user_name(idname31);
    
get_user_authid(idauthid31); 
    
client_print(0print_chat"%s %s(%s) has Left the server."headernameauthid);


public 
postnow() 
{
    new 
name[32], authid[32];
    
get_user_name(idname31);
    
get_user_authid(idauthid31);
    
client_print(0print_chat"%s %s(%s)"headernameauthid);



Arkshine 06-29-2009 03:34

Re: Steam id poster
 
If you want to show all the steamid at once using the command, you have to loog through all players.


All times are GMT -4. The time now is 15:40.

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