Raised This Month: $ Target: $400
 0% 

Weird problem.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 11-18-2017 , 18:37   Weird problem.
Reply With Quote #1

Hey guys, I recently made this plugin for my server, and everything looked and worked well.

Today I entered a server and for everyone else it worked perfectly, but for me, I had the default say ( Like it returned continue ). Then my brother joined and he had the default say and everything was working fine for me.

Im loosing my mind and have no clue whats happening, please help.

Also please dont answer me something on the lines of "There is a plugin for this already" We had some problems with those so i made this one which does exactly what i need, no reason to use anything more. But if there are any code errors please be sure to point them out!

PHP Code:
#include <amxmodx>
#include <amxmisc>

#include < colorchat >

#pragma semicolon 1

new const     plugin[]    =    "chat",
        
version[]    =    "1.4",
        
author[]    =    "maqi";

#define ADMIN_FLAGS     ADMIN_BAN
#define VIP_FLAGS     ADMIN_LEVEL_C

new const    ADMIN_PREFIX[]     =     "[Admin]",
        
VIP_PREFIX[]     =     "[Vip]";
        
new        
bool:hasPrefix[32] = true;

new 
Color:iColor;

public 
plugin_init() 
{
    
register_pluginpluginversionauthor );
    
    
register_clcmd"say""SayRegistered" );
    
register_clcmd"say_team""SayRegistered" );
}
public 
client_authorizedid )
    
hasPrefixid ] = true;

public 
SayRegisteredid )
{
    new     
said[192],
        
player[32],
        
team[20],
        
cmd[9],
        
arg1[9],
        
prefix[8],
        
dead[8];
        
    
    
read_argv0cmdcharsmax(cmd) );
    
read_argv1arg1charsmax(arg1) );
    
read_argssaidcharsmax(said) );
    
remove_quotessaid );
    
get_user_nameidplayercharsmax(player) );
        
    if( 
equaliarg1"/prefix" ) )
        
PrefixToggleid );    
        
    if( 
said[0] == '/' || equalisaid"" ) )
        return 
PLUGIN_HANDLED;
    
    if( 
get_user_flagsid ) & ADMIN_FLAGS && hasPrefixid ] )
        
copyprefixcharsmax(prefix), ADMIN_PREFIX );
    else if ( 
get_user_flagsid ) & VIP_FLAGS && hasPrefixid ] )
        
copyprefixcharsmax(prefix), VIP_PREFIX );    
    else
        
copyprefixcharsmax(prefix), "" );
        
    if( 
get_user_teamid ) == )
        
copydeadcharsmax(dead), " SPEC " );    
    else if( !
is_user_aliveid ) )
        
copydeadcharsmax(dead), " DEAD " );    
    else
        
copydeadcharsmax(dead), "" );
    
    switch ( 
get_user_teamid ) )
    {
        case 
1:
        {
            if( 
equalcmd"say_team") )
                
copyteamcharsmax(team), "(Terrorist)" );
            
iColor RED;
        }
        case 
2:
        {
            if( 
equalcmd"say_team") )
                
copyteamcharsmax(team), "(Counter-Terrorist)" ); 
            
iColor BLUE;
        }
        case 
3:
        {
            if( 
equalcmd"say_team") )
                
copyteamcharsmax(team), "(Spectator)" );    
            
iColor GREEN;
        }
        default:
            return 
PLUGIN_CONTINUE;
    }
    
    new    
sFormat[192];
    
    if( !
is_user_aliveid ) )
        
formatsFormatcharsmax(sFormat), "^x04%s^x01%s%s^x03%s: ^x01%s"prefixdeadteamplayersaid ); 
    else if( ( 
get_user_flagsid ) & ADMIN_FLAGS  || get_user_flagsid ) & VIP_FLAGS || equalcmd"say_team") ) && hasPrefixid ] )
        
formatsFormatcharsmax(sFormat), "^x04%s^x01%s%s^x03 %s: ^x01%s"prefixdeadteamplayersaid );
    else
        
formatsFormatcharsmax(sFormat), "^x04%s^x01%s%s^x03%s: ^x01%s"prefixdeadteamplayersaid ); 
        
    if( 
equalcmd"say_team") )
    {
        new    
pnum,
            
players[32];
        
        
get_playersplayers,pnum );
        
        for( new 
i;pnum;i++ )
        {
            if( 
get_user_teamid ) == get_user_teamplayer[i] ) || get_user_flagsplayer[i] ) & ADMIN_FLAGS )
                
ColorChatplayers[i] , iColorsFormat );
        }
    }
    
    
ColorChat0iColorsFormat );
    
    return 
PLUGIN_HANDLED;
}

public 
PrefixToggleid )
{
    if( 
get_user_flagsid ) & ADMIN_FLAGS || get_user_flagsid ) & VIP_FLAGS )
    {
        if( 
hasPrefixid ] )
        {
            
hasPrefixid ] = false;
            
ColorChatidGREEN"^x04[chat]^x01 Admin Prefix Disabled." );
        } else {
            
hasPrefixid ] = true;
            
ColorChatidGREEN"^x04[chat]^x01 Admin Prefix Enabled." );
        }
    }


Thanks in advance
maqi is offline
 



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 09:05.


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