AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   About HUD (https://forums.alliedmods.net/showthread.php?t=221645)

AwesomeMan 07-24-2013 18:19

About HUD
 
Hey, so im working on a plugin with xp and things like that, have the xp system working etc...
but im facing a problem, iwant a hud message that stays all the time and doesnt dissapear.
This is what i have tried:
Code:

public showallhud()
{
        set_hudmessage(255, 255, 255, 0.02, 0.92, 0, 6.0, 12.0, 0.01, 0.01, 23)
        new players[32], pnum, tempid;
        get_players( players, pnum );
        for ( new i; i < pnum; i++ )
        {
                tempid = players[i];
                ShowSyncHudMsg(tempid, hud, "Suspect: #%d -- HP: %d^nXP: %i", tempid, get_user_health(tempid), PlayerXP[tempid])
                }
               
        }
        set_task(5.0,"showallhud")
}

However, it does dissapear, appear again many times and i just want it to stay all the time but only XP to change. Any ideas?

wickedd 07-24-2013 23:01

Re: About HUD
 
PHP Code:

set_task(0.1,"showallhud"


DWIGHTpN 07-25-2013 04:29

Re: About HUD
 
new -> static
Code:

set_hudmessage(255, 255, 255, 0.02, 0.92, 0, 6.0, 12.0, 0.01, 0.01, 23)
->
Code:

set_hudmessage(255, 255, 255, 0.02, 0.92, 0, 6.0, 1.0, 0.01, 0.01, 4)
Max channel is 4 (or -1) not 23.


Code:

for(new i;i < pnum;i++ )
->
Code:

for(new i = 0;i < pnum;i++ )

PHP Code:

public plugin_init()
{
        
//code..
        
set_task1.0"showallhud"12321__"b" );
}

public 
showallhud() {    
         
set_hudmessage(2552552550.020.9206.01.00.010.014)     
         static 
players[32], pnumtempid;     
         
get_playersplayerspnum );     
         for ( new 
0pnumi++ )     {         
                
tempid players[i];         
                
ShowSyncHudMsg(tempidhud"Suspect: #%d -- HP: %d^nXP: %i"tempidget_user_health(tempid), PlayerXP[tempid])
          }



AwesomeMan 07-25-2013 05:28

Re: About HUD
 
Quote:

Originally Posted by DWIGHTpN (Post 1998268)
new -> static
Code:

set_hudmessage(255, 255, 255, 0.02, 0.92, 0, 6.0, 12.0, 0.01, 0.01, 23)
->
Code:

set_hudmessage(255, 255, 255, 0.02, 0.92, 0, 6.0, 1.0, 0.01, 0.01, 4)
Max channel is 4 (or -1) not 23.


Code:

for(new i;i < pnum;i++ )
->
Code:

for(new i = 0;i < pnum;i++ )

PHP Code:

public plugin_init()
{
        
//code..
        
set_task1.0"showallhud"12321__"b" );
}

public 
showallhud() {    
         
set_hudmessage(2552552550.020.9206.01.00.010.014)     
         static 
players[32], pnumtempid;     
         
get_playersplayerspnum );     
         for ( new 
0pnumi++ )     {         
                
tempid players[i];         
                
ShowSyncHudMsg(tempidhud"Suspect: #%d -- HP: %d^nXP: %i"tempidget_user_health(tempid), PlayerXP[tempid])
          }



Cheers! That works really great :D
Thanks!


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

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