AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   "fxtime" parameter (for hudmsgs and dhudmsgs) (https://forums.alliedmods.net/showthread.php?t=189924)

meTaLiCroSS 07-12-2012 14:30

"fxtime" parameter (for hudmsgs and dhudmsgs)
 
Well, i've been testing the usage of Director HUD Messages for knowing how to use it's parameters, and while testing i've noticed that the "fxtime" param doesn't seem to work for something

I did a testing plugin for this:

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLUGIN "Director HUD Testing"
#define VERSION "0.1"
#define AUTHOR "meTaLiCroSS"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("dhud""clcmd_DirectorHUDMessage")
}

public 
clcmd_DirectorHUDMessage(iId)
{
    new 
messageText32 ]; 
    new 
redColor]; 
    new 
greenColor]; 
    new 
blueColor]; 
    new 
coordX]; 
    new 
coordY]; 
    new 
effectType];
    new 
timeEffect]; 
    new 
timeHold];
    new 
timeFadeIn]; 
    new 
timeFadeOut]; 
    
    
read_argv1messageTextcharsmaxmessageText ) ); 
    
read_argv2redColorcharsmaxredColor ) ); 
    
read_argv3greenColorcharsmaxgreenColor ) ); 
    
read_argv4blueColorcharsmaxblueColor ) ); 
    
read_argv5coordXcharsmaxcoordX ) ); 
    
read_argv6coordYcharsmaxcoordY ) ); 
    
read_argv7effectTypecharsmaxeffectType ) ); 
    
read_argv8timeEffectcharsmaxtimeEffect ) ); 
    
read_argv9timeHoldcharsmaxtimeHold ) ); 
    
read_argv10timeFadeIncharsmaxtimeFadeIn ) ); 
    
read_argv11timeFadeOutcharsmaxtimeFadeOut ) ); 
    
    
DirectorHUDMessage
    
(
        
iId,
        .
szMessage messageText,
        .
iRed str_to_num(redColor),
        .
iGreen str_to_num(greenColor),
        .
iBlue str_to_num(blueColor),
        .
flX str_to_float(coordX),
        .
flY str_to_float(coordY),
        .
iEffect str_to_num(effectType),
        .
flEffectTime str_to_float(timeEffect),
        .
flHoldTime str_to_float(timeHold),
        .
flFadeInTime str_to_float(timeFadeIn),
        .
flFadeOutTime str_to_float(timeFadeOut)
    )
    
    return 
PLUGIN_HANDLED
}

stock DirectorHUDMessage(const iId, const szMessage[], const iRed 0, const iGreen 160, const iBlue 0, const Float:flX = -1.0, const Float:flY 0.65, const iEffect 2, const Float:flEffectTime 6.0, const Float:flHoldTime 3.0, const Float:flFadeInTime 0.1, const Float:flFadeOutTime 1.5)
{
    
message_begin(iId MSG_ONE_UNRELIABLE MSG_BROADCASTSVC_DIRECTOR, .player iId)
    
write_byte(strlen(szMessage) + 31); // size of all write_*
    
write_byte(DRC_CMD_MESSAGE);
    
write_byte(iEffect);
    
write_long(iBlue + (iGreen<<8) + (iRed<<16))
    
write_long(_:flX)
    
write_long(_:flY)
    
write_long(_:flFadeInTime)
    
write_long(_:flFadeOutTime)
    
write_long(_:flHoldTime)
    
write_long(_:flEffectTime)
    
write_string(szMessage);
    
message_end();


So I only need to paste on console:

Code:

dhud DirectorHUDMessageTesting 0 200 200 -1.0 0.15 2 0.0 2.0 0.1 3.0
Let's see:

rgb = { 0, 200, 200 } (skyblue)
pos = { -1.0, 0.15 }
effect = 2 (training room text, writes char by char)
fxtime = 0.0, i've testing using 10.0, 20.0, 30.0 and the hud didn't change at all
holdtime = 2.0, the hudmsg will stay 2 seconds
fadeintime = 0.1, in this case, the time that every char will be printed
fadeouttime = 3.0, when holdtime ends, the time that the message will slowly dissapear

So, my question is

What's the functionality of the "fxtime" parameter, for hudmessages and director hudmessages? It seems that it's the same thing anyway

ConnorMcLeod 07-12-2012 14:32

Re: "fxtime" parameter (for hudmsgs and dhudmsgs)
 
Try to set holdtime greater than fxtime for effect = 2, fxtime is not used on effect == 0 or effect == 1

meTaLiCroSS 07-12-2012 15:19

Re: "fxtime" parameter (for hudmsgs and dhudmsgs)
 
Quote:

Originally Posted by ConnorMcLeod (Post 1748881)
Try to set holdtime greater than fxtime for effect = 2, fxtime is not used on effect == 0 or effect == 1

I tried with:

holdtime = 5.0
fxtime = 3.0

holdtime = 5.0
fxtime = 2.0

holdtime = 5.0
fxtime = 1.0

And it was the same thing on every dhudmsg displayed :|

ConnorMcLeod 07-12-2012 16:00

Re: "fxtime" parameter (for hudmsgs and dhudmsgs)
 
Try hudmessage

meTaLiCroSS 07-12-2012 16:49

Re: "fxtime" parameter (for hudmsgs and dhudmsgs)
 
Quote:

Originally Posted by ConnorMcLeod (Post 1748942)
Try hudmessage

Oh i've noticed the difference! Seems that DHud Messages doesn't use the fxtime parameter... I don't think that my CS is wrong, maybe someone could test it too and see which thing happens


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

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