AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Client Connect Messages...... (https://forums.alliedmods.net/showthread.php?t=229798)

AssAssIN_IMpossible 11-15-2013 06:54

Client Connect Messages......
 
I want a plugin which displays chat messages to a specific client when he connects......

below is my code

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Client connect messages"
#define VERSION "1.0"
#define AUTHOR "AssAssIN_IMpossible"


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

// Add your code here...
}

public client_connect(id)
{
client_print(id, print_chat, "[DHASSASSINS] A new client just joined the gaming competition")

}

I want a hudmessage which shows the player name and player IP

/* I am expert in Java and a beginner with pawn and c++*/

bat 11-15-2013 07:14

Re: Client Connect Messages......
 
Code:

public client_connect(id)
{
client_print(id, print_chat, "[DHASSASSINS] A new client just joined the gaming competition")

}


------------->

Code:

public client_connect(id)
{
          set_humessage(255, 200, 3, 0.02, 0.87, 0, 6.0, 1.1, 0.0, 0.0, -1)
          show_hudmessage(id, "[DHASSASSINS] A new client just joined the gaming competition")
}


micapat 11-15-2013 08:51

Re: Client Connect Messages......
 
Nope.

client_putinserver + set_task.

xoxolala 11-15-2013 10:45

Re: Client Connect Messages......
 
Not tested, but should work.

EDIT:
Changed
PHP Code:

set_task 5.0"CmdShowHud"

----->
PHP Code:

set_task 5.0"CmdShowHud"id 

EDIT 2:
PHP Code:

if ( is_user_connected id ) ) 

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Connect Message"
#define VERSION "1.0"
#define AUTHOR "xoxolala"

const MAX_CLIENTS 32

new gUserIP MAX_CLIENTS ] [ 36 ]
new 
gUserID MAX_CLIENTS ] [ 36 ]
new 
gUserName MAX_CLIENTS ] [ 36 ]

public 
plugin_init ( )
{
    
register_plugin PLUGINVERSIONAUTHOR )
}

public 
client_putinserver id )
{
    
get_user_authid idgUserID id ], charsmax gUserID [ ] ) )
    
get_user_ip idgUserIP id ], charsmax gUserIP [ ] ), )
    
get_user_name idgUserName id ], charsmax gUserName [ ] ) )
    
    
set_task 5.0"CmdShowHud"id )
}

public 
CmdShowHud id )
{
    if ( 
is_user_connected id ) )
    {
        
set_hudmessage(25520030.020.8706.01.10.00.0, -1)
        
show_hudmessage 0"%s recently joined. [SteamID: %d] [IP: %d]"gUserName id ], gUserID id ], gUserIP id ] )
    }



baneado 11-15-2013 16:06

Re: Client Connect Messages......
 
in CmdShowHud, you must to check if user is still connected

gUserName is bad created, look it, it's a string with no lenght

xoxolala 11-15-2013 17:23

Re: Client Connect Messages......
 
Quote:

Originally Posted by baneado (Post 2061278)
in CmdShowHud, you must to check if user is still connected

gUserName is bad created, look it, it's a string with no lenght

Changed

Works without it, but thx anyways. :)


All times are GMT -4. The time now is 23:13.

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