Raised This Month: $ Target: $400
 0% 

[SOLVED] Permanant HUD Message Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-26-2013 , 22:50   [SOLVED] Permanant HUD Message Help
Reply With Quote #1

im trying to get a Constant HUD Message Display..

using same code from my other plugins but it doesnt seem to work...

and now showing any errors in logs..

in my plugin_init()

PHP Code:
set_task(1.0"ShowHud"___"b"
and then the ShowHud(id)

PHP Code:
public ShowHud(id)
{
    if(!
is_user_alive(id))
        return;
        
    
set_hudmessage(2552552550.010.1800.01.0__, -)
    
show_hudmessage(id"%s^n%s: %i"SKINS[sz_ModelName[id]], CurrencyShop_XP[id])

any ideas?

Last edited by Blizzard_87; 01-27-2013 at 03:05.
Blizzard_87 is offline
michal123
Junior Member
Join Date: Feb 2011
Location: Poland
Old 01-27-2013 , 02:36   Re: Permanant HUD Message Help
Reply With Quote #2

This task hasn't got id. You must do the loop. In the global variables add:
Code:
new g_MaxPlayers;
Next add function public plugin_cfg:
Code:
public plugin_cfg(){
	g_MaxPlayers = get_maxplayers();
}
Replace your code with this:
Code:
public ShowHud(){
	for(new i = 1; i <= g_MaxPlayers; i++){ 
		if(is_user_alive(i)){
			set_hudmessage(255, 255, 255, 0.01, 0.18, 0, 0.0, 1.0, _, _, -1 );
			show_hudmessage(i, "%s^n%s: %i", SKINS[sz_ModelName[i]], Currency, Shop_XP[i]);
		}
	}
}
You can replace this:
Code:
set_task(1.0, "ShowHud", _, _, _, "b")
For:
Code:
set_task(1.0, "ShowHud",.flags = "b")
If you want do this without loop, create task in:
Code:
public client_putinserver(id)
michal123 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-27-2013 , 03:04   Re: Permanant HUD Message Help
Reply With Quote #3

works thanks ...
Blizzard_87 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 20:36.


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