Raised This Month: $ Target: $400
 0% 

Client Connect Messages......


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AssAssIN_IMpossible
BANNED
Join Date: Nov 2013
Location: india
Old 11-15-2013 , 06:54   Client Connect Messages......
Reply With Quote #1

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++*/
AssAssIN_IMpossible is offline
bat
Veteran Member
Join Date: Jul 2012
Old 11-15-2013 , 07:14   Re: Client Connect Messages......
Reply With Quote #2

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")
}
__________________

Last edited by bat; 11-15-2013 at 07:14.
bat is offline
Send a message via Skype™ to bat
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 11-15-2013 , 08:51   Re: Client Connect Messages......
Reply With Quote #3

Nope.

client_putinserver + set_task.
__________________
micapat is offline
xoxolala
Junior Member
Join Date: Nov 2013
Old 11-15-2013 , 10:45   Re: Client Connect Messages......
Reply With Quote #4

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 ] )
    }


Last edited by xoxolala; 11-15-2013 at 17:26.
xoxolala is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-15-2013 , 16:06   Re: Client Connect Messages......
Reply With Quote #5

in CmdShowHud, you must to check if user is still connected

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

Last edited by baneado; 11-15-2013 at 16:08.
baneado is offline
xoxolala
Junior Member
Join Date: Nov 2013
Old 11-15-2013 , 17:23   Re: Client Connect Messages......
Reply With Quote #6

Quote:
Originally Posted by baneado View Post
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.

Last edited by xoxolala; 11-15-2013 at 17:26.
xoxolala 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 23:13.


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