Raised This Month: $ Target: $400
 0% 

Client_Connect Message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 05-17-2012 , 11:37   Client_Connect Message
Reply With Quote #1

Code:
public plugin_init() {
	register_plugin("PLUGIN1", "1.0", "Waleed")
	}

public client_putinserver(playerid){

if(is_user_connected(playerid)){
new string[100];
new name[32]
	get_user_name(playerid, name, charsmax(name))
	format(string, sizeof(string), "%s has joined the server!", name);
	set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 6.0, 30.0, 1.0, 10)
	show_hudmessage(playerid, "Welcome To My Server", string)
		return 1;}}
I want to display New Connected Players name in Middle HUD,But its not working,Any suggestions.
Waleed is offline
Send a message via Skype™ to Waleed
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-17-2012 , 11:46   Re: Client_Connect Message
Reply With Quote #2

Make a task to display the hud message after some seconds (because you can't show a message to a player, that has just joined the server).
You don't need to return anything in client_putinserver.
fadeoutout (last parameter in your set_hudmessage) is a float.
__________________

Last edited by <VeCo>; 05-17-2012 at 11:46.
<VeCo> is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-17-2012 , 11:52   Re: Client_Connect Message
Reply With Quote #3

PHP Code:
new g_SyncObj
public plugin_init() { 
    
register_plugin("PLUGIN1""1.0""Waleed")
        
g_syncObj CreateHudSyncObj()
    }

public 
client_putinserver(playerid){

if(
is_user_connected(playerid)){
new 
string[100];
new 
name[32]
    
get_user_name(playeridnamecharsmax(name))
    
format(stringsizeof(string), "%s has joined the server!"name);
    
set_hudmessage(0255033.031.006.030.01.010.0)
    
ShowSyncHudMsg(playeridg_SyncObj"Welcome to my server")
        return 
1;}} 
Change your hud message to a sync hud, changed your hud placement (using AMXX-Studio's HUD generator) to be just above the crossahair (-1 -1 hasn't worked for me in the past)

And put it on a task. VeCo is right.

I also suppose you'd like string[] to be displayed to everyone else. You'll have to loop through all clients and desplay it to them individually.

Last edited by Liverwiz; 05-17-2012 at 11:54.
Liverwiz is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-17-2012 , 11:57   Re: Client_Connect Message
Reply With Quote #4

Quote:
Originally Posted by Liverwiz View Post
set_hudmessage(0, 255, 0, 33.0, 31.0, 0, 6.0, 30.0, 1.0, 10.0)
That should be 0.33 and 0.31

My mistake.
Liverwiz is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-17-2012 , 11:52   Re: Client_Connect Message
Reply With Quote #5

-1.0 should work fine, it's centered.
__________________
<VeCo> is offline
Reply


Thread Tools
Display Modes

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 00:21.


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