AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SayText Color Messages (https://forums.alliedmods.net/showthread.php?t=50231)

Arkshine 01-22-2007 02:17

SayText Color Messages
 
2 Attachment(s)
Hi,

Here a little script which show color messages in the chat (infinite loop) from a file (configs/messages_list.cfg).
You can specify a map to show a message on this map only. Map can also be a map type.
If none is specified, assume we want to show the message everytime.
  • Color Codes:

    $e = Team Color (red/blue/gray)
    $n = normal color (con_color, default: yellowish)
    $g = green
  • Syntax: "message" "map"

    "$eLook! I'm the same color as your team! $nOooh, pretty classic color! $gYay, I'm green!" "de_dust2"
    "$eGaaaawwwr! $gBleeeeeh!" "de_"
    "$gHello world!"
  • Cvars:

    amx_cm_delay "30" // Specify number of seconds between two messages

It works fine. But maybe there are some optimisations to do or some bugs to find.
Any comments are welcome.


Thanks for your help! :up:

osk522 01-22-2007 12:02

Re: SayText Color Messages
 
Take a look at the source code:
http://forums.alliedmods.net/showthread.php?p=127273


Code:

i_like_cookies_and_milk("Oskar")

jim_yang 01-22-2007 12:14

Re: SayText Color Messages
 
Code:
vformat( newMsg, 191, msg, 2 );         replace_all( newMsg, 191, "$e", "^x03");                 replace_all( newMsg, 191, "$g", "^x04");                 replace_all( newMsg, 191, "$n", "^x01");                 formatex( message, 191, "^x01%s", newMsg ); for( i = 0; i < num; i++ ) {                 message_begin( MSG_ONE, g_SayText, {0,0,0}, players[i] );         write_byte( players[i] );         write_string( message );         message_end( ); }
make the format part out of the loop

Arkshine 01-22-2007 14:24

Re: SayText Color Messages
 
@jim_yang :

Oops. Fixed.

Thanks.

MaximusBrood 01-22-2007 14:51

Re: SayText Color Messages
 
I don't know if you are submitting this later, but doesn't my plugin cover all this fully?

http://forums.alliedmods.net/showthread.php?t=27814

Arkshine 01-22-2007 15:21

Re: SayText Color Messages
 
No, I have no intention to submit this.

Also your plugin is perfect. :mrgreen:

Thanks :)


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

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