Raised This Month: $ Target: $400
 0% 

Colorchat Message_begin error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
proffs
Senior Member
Join Date: Jul 2013
Old 03-15-2014 , 10:21   Colorchat Message_begin error
Reply With Quote #1

L 03/15/2014 - 14:16:09: [AMXX] Run time error 10: native error (native "message_begin")
L 03/15/2014 - 14:16:09: [AMXX] [0] LRV1.0.sma::ColorChat (line 2061)
L 03/15/2014 - 14:16:09: [AMXX] [1] LRV1.0.sma::Cmd_LastRequest (line 970)

PHP Code:
ColorChatidcolour, const text[], any:... )
{
    if( !
get_playersnum() )
    {
        return;
    }
    
    static 
message[192];
    
    
message[0] = 0x01;
    
vformat(message[1], sizeof(message) - 1text4);
    
    
replace_all(messagesizeof(message) - 1"!g""^x04");
    
replace_all(messagesizeof(message) - 1"!n""^x01");
    
replace_all(messagesizeof(message) - 1"!t""^x03");
    
    static 
indexMSG_Type;
    
    if( !
id )
    {
        static 
i;
        for(
1<= g_iMaxPlayersi++)
        {
            if( 
g_bConnected[i] )
            {
                
index i;
                break;
            }
        }
        
        
MSG_Type MSG_ALL;
    }
    else
    {
        
MSG_Type MSG_ONE;
        
index id;
    }
    
    static 
bool:bChanged;
    if( 
colour == GREY || colour == RED || colour == BLUE )
    {
        
message_begin(MSG_Typeg_msgTeamInfo_index);
        
write_byte(index);
        
write_string(g_szTeamName[colour]);
        
message_end();
        
        
bChanged true;
    }
    
    
message_begin(MSG_Typeg_msgSayText_index);
    
write_byte(index);
    
write_string(message);
    
message_end();
    
    if( 
bChanged )
    {
        
message_begin(MSG_Typeg_msgTeamInfo_index);
        
write_byte(index);
        
write_string(g_szTeamName[_:cs_get_user_team(index)]);
        
message_end();
    }

proffs is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 03-15-2014 , 12:01   Re: Colorchat Message_begin error
Reply With Quote #2

Use this.

PHP Code:
ColorChatidColor:type, const msg[ ], { FloatSqlResult}:... )
{
        static 
SayText;

        if( !
SayText )
        
SayText get_user_msgid"SayText" );
    
        static 
message256 ];
    
        switch( 
type )
        {
                case 
GREEN// Green
                
{
                        
message] = 0x04;
                }
                case 
TEAM_COLOR// Team Color. Ie. Red (Terrorist) or blue (Counter-Terrorist).
                
{
                        
message] = 0x03;
                }
                default: 
// Yellow.
                
{
                        
message] = 0x01;
                }
        }

        
vformatmessage], 251msg);

        
message192 ] = '^0';

        if( 
id )
        {
                if( 
is_user_connectedid ) )
                {
                        
message_beginMSG_ONESayText, { 00}, id );
                        
write_byteid );
                        
write_stringmessage );
                        
message_end( );
                }
        } 
    
        else 
        {
                static 
Players32 ]; new CountIndex;
                
get_playersPlayersCount );
        
                for( new 
Count i++ )
                {
                        
Index Players];
            
                        
message_beginMSG_ONESayText, { 00}, Index );
                        
write_byteIndex );
                        
write_stringmessage );
                        
message_end( );
            
                }
        }

__________________
Like my clean plugins and work?
Baws is offline
proffs
Senior Member
Join Date: Jul 2013
Old 03-15-2014 , 12:12   Re: Colorchat Message_begin error
Reply With Quote #3

I want to use mine, Can you help me to fix it?
proffs is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 03-15-2014 , 12:13   Re: Colorchat Message_begin error
Reply With Quote #4

Why not use colorchat/chatcolor.inc?
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
proffs
Senior Member
Join Date: Jul 2013
Old 03-15-2014 , 12:15   Re: Colorchat Message_begin error
Reply With Quote #5

Quote:
Originally Posted by ironskillz1 View Post
Why not use colorchat/chatcolor.inc?
Because this is a really huge plugin I dont got time to change every part.
proffs is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 03-15-2014 , 12:20   Re: Colorchat Message_begin error
Reply With Quote #6

With the code i gave you, you can fix it by looking at my code and your code. Then you will see that there's something wrong
__________________
Like my clean plugins and work?
Baws 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 06:00.


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