Raised This Month: $ Target: $400
 0% 

how to make a Hud text


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dEvilKinG
Junior Member
Join Date: Nov 2007
Old 08-14-2008 , 10:29   how to make a Hud text
Reply With Quote #1

Hello i want you to help me to make a hud text like amx_tsay but i want to make it have infinite time
some one please?
dEvilKinG is offline
Iwon
BANNED
Join Date: Jul 2008
Old 08-14-2008 , 11:59   Re: how to make a Hud text
Reply With Quote #2

PHP Code:
set_hudmessage(00255, -1.0, -1.006.00)
show_hudmessage(id"Your Message here"
There it is infinute time change your message here to your message.
Iwon is offline
dEvilKinG
Junior Member
Join Date: Nov 2007
Old 08-14-2008 , 15:06   Re: how to make a Hud text
Reply With Quote #3

Quote:
Originally Posted by Iwon View Post
PHP Code:
set_hudmessage(00255, -1.0, -1.006.00)
show_hudmessage(id"Your Message here"
There it is infinute time change your message here to your message.
look i want to make it to show this message continues.. this is for 0 sec just a moment
dEvilKinG is offline
Zero [UM-wFs]
Junior Member
Join Date: Aug 2008
Old 08-14-2008 , 16:02   Re: how to make a Hud text
Reply With Quote #4

this will do it

Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
public plugin_init() 
{
    register_plugin("plugin_name", "version", "author");
    register_forward(FM_PlayerPostThink, "PlayerPostThink");

}

public PlayerPostThink(id)
{
    set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 0);
    show_hudmessage(id, "Your Message here");
}
__________________


Zero [UM-wFs] is offline
Send a message via Yahoo to Zero [UM-wFs]
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 08-14-2008 , 16:39   Re: how to make a Hud text
Reply With Quote #5

It's absolutely not necessary to call the hudmessage on player think. You should create a HudSyncObj and update the message in 0.5,or 1.0 seconds, nothing very heavy. Like this:
Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    register_task(1.0,"ShowHUDMessage")
}

public ShowHudMessage()
{
    static HudSyncObj
    if(!HudSyncObj)
        HudSyncObj = CreateHudSyncObj()

    static iMaxPlayers
    if(!iMaxPlayers)
        iMaxPlayers = get_maxplayers()

    for(new i=1;i <= iMaxPlayer;i++)
    {
        if(is_user_connected(i))
        {
            set_hudmessage(_,_,_,_,_,_,0.5,1.0)
            ShowSyncHudMsg(i,HudSyncObj,"This is a test message")
        }
    }
}
danielkza is offline
Iwon
BANNED
Join Date: Jul 2008
Old 08-14-2008 , 19:40   Re: how to make a Hud text
Reply With Quote #6

Quote:
Originally Posted by dEvilKinG View Post
look i want to make it to show this message continues.. this is for 0 sec just a moment
Ahh i know what u mean here you go
PHP Code:
    set_hudmessage(00255, -1.0, -1.006.00.1);
    
show_hudmessage(id"Your Message here"); 
Iwon is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 08-14-2008 , 20:45   Re: how to make a Hud text
Reply With Quote #7

Iwon, stop posting code you don't understand.

danielkza, register_task() is undefined. You don't need to iterate over each player when using HUD messages because passing 0 as the player ID does so automatically. I'm glad you raised the issue of the FM_PlayerPostThink, but the same can be said of set_task() (assuming that's what you intended to use).

If this were my server, I'd be displaying the HUD message for (mp_roundtime * 60) seconds once per round, but you'd need to make sure other plugins play nicely to do that. I'm pretty sure ESEA uses this method. Come to think of it, try this:

Code:
#include <amxmodx> #pragma semicolon 1 new mp_roundtime; public plugin_init() {     register_event("HLTV", "onNewRound", "a", "1=0", "2=0");         mp_roundtime = get_cvar_pointer("mp_roundtime"); }     public client_putinserver(id) {     //I'm not too sure how HUD messages interact with the MOTD     showMessage(id); } public onNewRound() {     showMessage(); } showMessage(id = 0) {     //what a hideous native     set_hudmessage (/*R*/ _, /*G*/ _, /*B*/ _, /*X*/ _, /*Y*/ _, /*effects*/ _, /*fxtime*/ _, /*holdtime*/     float(get_pcvar_num(mp_roundtime) * 60 + 15), /*fadeintime*/ _, /*fadeouttime*/ _, /*channel*/ 3);           show_hudmessage(id, "Hello World."); }
__________________
No support via PM.

Last edited by Lee; 08-14-2008 at 23:16.
Lee 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 03:15.


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