AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Permanent chat message (on some possition) (https://forums.alliedmods.net/showthread.php?t=242670)

Flick3rR 06-22-2014 19:11

[HELP] Permanent chat message (on some possition)
 
1 Attachment(s)
Hey, guys! I want to ask you what are the parameters of message_begin, write_any, etc, to create a permanent chat message, mostly under chat. I would also ask you for some information about each part of the code, to know what I'm exactly doing. Where are the possition, the text, the type of message, the index, defined and what does every line mean. Thanks alot, cuz I know someone will help with that easy one! Example picture attached.

wickedd 06-22-2014 19:18

Re: [HELP] Permanent chat message (on some possition)
 
Search "Statustext".

Flick3rR 06-22-2014 19:25

Re: [HELP] Permanent chat message (on some possition)
 
Found some info! Okay, now the other question - how to use it? I mean, probably I have to register_message("some_message", "its_function")
but how can I hook it only for alive, only for dead, and when it's called? Something I can't find...

wickedd 06-22-2014 19:56

Re: [HELP] Permanent chat message (on some possition)
 
You would show like you would any other message.
Try the code below, you will need the colorstatus.inc from this thread. It should give an idea of how to use it.

PHP Code:

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <colorstatus.inc>

new g_iMax;

public 
plugin_init() {
    
    
set_task(1.0"Teams"0""0"b")
    
    
g_iMax get_maxplayers();
    
initColorStatus();
}

public 
TeamsiPlayer )
{

    for(new 
iPlayer 1iPlayer <= g_iMaxiPlayer++ ) 
{
    if ( !
is_user_aliveiPlayer ) || is_user_botiPlayer ) )
        continue;
    
    switch ( 
get_user_teamiPlayer ) )
    {
        case 
CS_TEAM_T:
        {
            
makeStatusText(iPlayer,RED_STATUS,0.0," : [Terrorist]" );
        }
        case 
CS_TEAM_CT:
        {
            
makeStatusText(iPlayer,BLUE_STATUS,0.0," : [Counter Terrorist]" );
        }
    }
}  




Flick3rR 06-22-2014 20:01

Re: [HELP] Permanent chat message (on some possition)
 
Wow, that's some other way. Thanks for that method! But I'm still interested of the method with message_begin and the most detailed way.

georgik57 06-23-2014 05:00

Re: [HELP] Permanent chat message (on some possition)
 
The annoying part about this is that if the client has "hud_centerid 1" it will appear in the middle.

GinNNy 06-23-2014 05:59

Re: [HELP] Permanent chat message (on some possition)
 
Why is it #include <colorstatus.inc>
why not just #include <colorstatus>

georgik57 06-23-2014 06:20

Re: [HELP] Permanent chat message (on some possition)
 
Quote:

Originally Posted by GinNNy (Post 2156022)
Why is it #include <colorstatus.inc>
why not just #include <colorstatus>

Both are the same thing.


All times are GMT -4. The time now is 21:15.

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