AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I have a doubt about TE_TEXTMESSAGE (https://forums.alliedmods.net/showthread.php?t=156883)

shinoda 05-13-2011 12:02

I have a doubt about TE_TEXTMESSAGE
 
In message_const.inc:
Code:

#define TE_TEXTMESSAGE              29
// write_byte(TE_TEXTMESSAGE)
// write_byte(channel)
// write_short(x) -1 = center)
// write_short(y) -1 = center)
// write_byte(effect) 0 = fade in/fade out, 1 is flickery credits, 2 is write out (training room)
// write_byte(red) - text color
// write_byte(green)
// write_byte(blue)
// write_byte(alpha)
// write_byte(red) - effect color
// write_byte(green)
// write_byte(blue)
// write_byte(alpha)
// write_short(fadein time)
// write_short(fadeout time)
// write_short(hold time)
// [optional] write_short(fxtime) time the highlight lags behing the leading text in effect 2
// write_string(text message) 512 chars max string size

And here's the most important part.
Code:

// [optional] write_short(fxtime) time the highlight lags behing the leading text in effect 2
Considering that i'll only use set_msg_arg_string( ... ). What's better?

PHP Code:

    static szMessage[512]
    
    if( 
get_msg_arg_int(5) == )
    {
        
get_msg_arg_string18szMessagecharsmax(szMessage) )
        if( 
equali(szMessage"MyString") )
        {
            
set_msg_arg_string(18"MyString2")
        }
    }
    
    
// Or
    
    
if( get_msg_args() == 18 )
    {
        
// Same as previous.
    
}
    
    
// Or
    
    // I think this is better
    
if( get_msg_arg_string(18szMessagecharsmax(szMessage)) )
    {
        if( 
equali(szMessage"MyString") )
        {
            
set_msg_arg_string(18"MyString2")
        }
    } 



All times are GMT -4. The time now is 04:30.

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