AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hud message (https://forums.alliedmods.net/showthread.php?t=190161)

smiley92 07-15-2012 12:42

Hud message
 
I don`t found any scripts to no appear message in hud for dead players,how I can do it?I want to appear message just to players alive.

Code:

#include <amxmodx>

static const PLUGIN[ ]= "Details Server";
static const VERSION[ ]= "1.0";
static const AUTHOR[ ]= "Power";

static const g_szB[ ]= "b";


new SyncHudMessage;

public plugin_init( )
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
   
    SyncHudMessage = CreateHudSyncObj( );
   
    set_task( 1.0, "ShowMessage", _, _, _, g_szB );
}

public ShowMessage( )
{
    new Players[32], iNum;
    get_players(Players, iNum, "ch")
   
    new current_map[32]
        get_mapname(current_map, 31)
 
    new timeleft = get_timeleft( )
   
    for( new i = 0; i < iNum; i++ )
    {
        set_hudmessage(255, 255, 255, -1.0, 0.02, 0, 0.0, 1.0, 0.0, 1.0, 3 );
        ShowSyncHudMsg(0, SyncHudMessage, "| Timeleft: %d:%02d | http://www.forum.ro | Harta: %s |", timeleft / 60, timeleft % 60, current_map);
    }
}


EpicMonkey 07-15-2012 13:47

Re: Hud message
 
PHP Code:

get_players(PlayersiNum"a"

PHP Code:

ShowSyncHudMsg(Players[i], SyncHudMessage"| Timeleft: %d:%02d | http://www.forum.ro | Harta: %s |"timeleft 60timeleft 60current_map); 


smiley92 07-15-2012 14:29

Re: Hud message
 
tnx,work fine,but how I can put the message to be with random white?

GhostMan 07-15-2012 14:52

Re: Hud message
 
Not sure what you ment but if you want random color of hud msg you may use something like this

PHP Code:

new iRed =   random_num(0,255)
new 
iGreen random_num(0,255)
new 
iBlue =  random_num(0,255)


set_hudmessage(iRediGreeniBlue, -1.00.0200.01.00.01.0); 


smiley92 07-15-2012 14:54

Re: Hud message
 
and with white how I can put?

GhostMan 07-15-2012 15:00

Re: Hud message
 
I'm not sure that your asking for :O

The white colour of HUD is already set

set_hudmessage(255, 255, 255, -1.0, 0.02, 0, 0.0, 1.0, 0.0, 1.0, 3 )

255, 255, 255 is WHITE colour

smiley92 07-15-2012 15:07

Re: Hud message
 
2 Attachment(s)
is rgb with white,I see now,look photo(normal and with rgb or what is it)

vladhks 07-16-2012 04:15

Re: Hud message
 
Code:

#include < amxmodx >

new const PLUGIN[ ] = "Details Server";
new const VERSION[ ] = "1.0";
new const AUTHOR[ ] = "Power";

new const g_szB[ ]= "b";

new SyncHudMessage;

public plugin_init( )
{
    register_plugin( PLUGIN, VERSION, AUTHOR );
   
    SyncHudMessage = CreateHudSyncObj( );
   
    set_task( 1.0, "ShowMessage", _, _, _, g_szB );
}

public ShowMessage( )
{
    static iPlayer;

    static current_map[ 32 ];
    get_mapname( current_map, 31 )
 
    new timeleft = get_timeleft( )

    new szR = random( 255 )
    new szB = random( 255 )
    new szG = random( 255 )
   
    for( iPlayer = 1; iPlayer <= get_maxplayers( ); iPlayer++ )
  {
      if( is_user_alive( iPlayer ) )
    {
        set_hudmessage( szR, szB, szG, -1.0, 0.02, 0, 0.0, 1.0, 0.0, 1.0, 3 );
        ShowSyncHudMsg( 0, SyncHudMessage, "| Timeleft: %d:%02d | http://www.forum.ro | Harta: %s |", timeleft / 60, timeleft % 60, current_map );
      }
  }
}



All times are GMT -4. The time now is 14:58.

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