Raised This Month: $ Target: $400
 0% 

Help with HUD


Post New Thread Reply   
 
Thread Tools Display Modes
connoisseur
Senior Member
Join Date: Jan 2012
Old 07-19-2013 , 12:49   Re: Help with HUD
Reply With Quote #11

Quote:
Originally Posted by connoisseur View Post
I was actually looking forward to learn the sync-hud method.
Plus this one includes set_task which will be CPU consuming.
Sync-hud method, which I observed didn't use set_task.
connoisseur is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-19-2013 , 13:20   Re: Help with HUD
Reply With Quote #12

Quote:
Originally Posted by connoisseur View Post
Sync-hud method, which I observed didn't use set_task.
Well you have your answer then. Just look at the code and see how it is used.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
connoisseur
Senior Member
Join Date: Jan 2012
Old 07-19-2013 , 13:54   Re: Help with HUD
Reply With Quote #13

Quote:
Originally Posted by wickedd View Post
Well you have your answer then. Just look at the code and see how it is used.
....
I wouldn't post if I fully understood the code.
I'm looking for a simplified explanation, please read my first post.
connoisseur is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 07-19-2013 , 14:47   Re: Help with HUD
Reply With Quote #14

PHP Code:
new syncObj;

public 
plugin_precache() {
    
syncObj CreateHudSyncObj();
}
public 
ShowHud(id) {
    
// set_hudmessage stuff
    
ShowSyncHudMsg(idsyncObj"Message")

is that what you are asking for ?
akcaliberg is offline
connoisseur
Senior Member
Join Date: Jan 2012
Old 07-19-2013 , 14:55   Re: Help with HUD
Reply With Quote #15

Quote:
Originally Posted by akcaliberg View Post
PHP Code:
new syncObj;

public 
plugin_precache() {
    
syncObj CreateHudSyncObj();
}
public 
ShowHud(id) {
    
// set_hudmessage stuff
    
ShowSyncHudMsg(idsyncObj"Message")

is that what you are asking for ?
Yes, exactly. Now how do I make sure that this gets updated automatically when number of alive players change.
connoisseur is offline
DWIGHTpN
Senior Member
Join Date: Jan 2013
Location: Romania.
Old 07-22-2013 , 06:47   Re: Help with HUD
Reply With Quote #16

PHP Code:
#include <amxmodx>

new g_hudobj;

public 
plugin_init() {
        
register_plugin("hud_Alive","0.1.0","bla");
        
g_hudobj CreateHudSyncObj();   // Create a hud object
        
set_task1.0"taskAlive"0__"b" ); // Update alive players count every 1 sec.
}

public 
taskAlive() {
        static 
players32 ], NumPlayers;
        
get_playersplayersNumPlayers"ac" );
        
// a = don't return dead players..
        // c = skip bots.
        
set_hudmessage501502500.050.2801.01.00.010.01);
        
ShowSyncHudMsg0g_hudobj"Alive players: %d"NumPlayers );


Last edited by DWIGHTpN; 07-22-2013 at 06:50.
DWIGHTpN 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 06:20.


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