Raised This Month: $ Target: $400
 0% 

[plugin] tag admin, mod & vip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Balck
Senior Member
Join Date: Apr 2013
Location: Kosova-Mitrovica
Old 05-14-2013 , 14:13   Re: [plugin] tag admin, mod & vip
Reply With Quote #1

Quote:
Originally Posted by Toy0t1k View Post
Tell me what I have to change in your sma meter to get the HEAD-ADMIN writing with color "default color" and ADMIN writing with the color "green".

If you can, enter the part that changed in this post.
here is what you want
PHP Code:
/*
[colors]
"^1" // Yellow 
"^3" // Team color 
"^4" // Green

[Flags]
MOD        flags "abcdefghijklmnopqrstu"
ADMIN      flags "abcefghijkmnopqrstu"
VIP        flags "bcefghijkmnopqrstu"

*/

#include <amxmodx>  
#include <amxmisc>  

#define HEADADMINFLAG     ADMIN_IMMUNITY        //Flag "d" rcon access
#define ADMINFLAG         ADMIN_BAN            //Flag "a" immunity      
#define VIPFLAG           ADMIN_RESERVATION   //Flag "b"  RESERVATION   

new const tagcolor[ ] = "^4"  // Tag color
new const chatcolor[ ] = "^1" // Chat color
new const vipchatco[ ] = "^4" // VIp chat color

new const headadPrefix[ ] = "[ADMIN]" //You can change it if you want [vip] 

or what you want.
new const 
adminnPrefix[ ] = "[MOD]"      

///////////////////////////////////////////////////////
new const VIPpppPrefix[ ] = "[VIP]" 

public plugin_init() 
{  
    
register_plugin("Head & admin tag""1.0""Balck")  
    
register_clcmd("say""sayy")  
    
register_clcmd("say_team""sayyteam")
}  

// Colorchat
//////////////////////////////////////////
enum Color
{
    
NORMAL 1// clients scr_concolor cvar color
    
GREEN// Green Color
    
TEAM_COLOR// Red, grey, blue
    
GREY// grey
    
RED// Red
    
BLUE// Blue
}

new 
TeamName[][] = 
{
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    if( !
get_playersnum() ) return;
    
    new 
message[256];

    switch(
type)
    {
        case 
NORMAL// clients scr_concolor cvar color
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
                case 
GREY// Grey
                
{
                        
message[0] = 0x05;
                }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
// Make sure message is not longer than 192 character. Will crash 

the server.
    
message[192] = '^0';

    new 
teamColorChangeindexMSG_Type;
    
    if(
id)
    {
        
MSG_Type MSG_ONE;
        
index id;
    } else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);

    
ShowColorMessage(indexMSG_Typemessage);
        
    if(
ColorChange)
    {
        
Team_Info(indexMSG_TypeTeamName[team]);
    }
}

ShowColorMessage(idtypemessage[])
{
    static 
bool:saytext_used;
    static 
get_user_msgid_saytext;
    if(!
saytext_used)
    {
        
get_user_msgid_saytext get_user_msgid("SayText");
        
saytext_used true;
    }
    
message_begin(typeget_user_msgid_saytext_id);
    
write_byte(id)        
    
write_string(message);
    
message_end();    
}

Team_Info(idtypeteam[])
{
    static 
bool:teaminfo_used;
    static 
get_user_msgid_teaminfo;
    if(!
teaminfo_used)
    {
        
get_user_msgid_teaminfo get_user_msgid("TeamInfo");
        
teaminfo_used true;
    }
    
message_begin(typeget_user_msgid_teaminfo_id);
    
write_byte(id);
    
write_string(team);
    
message_end();

    return 
1;
}

ColorSelection(indextypeColor:Type)
{
    switch(
Type)
    {
        case 
RED:
        {
            return 
Team_Info(indextypeTeamName[1]);
        }
        case 
BLUE:
        {
            return 
Team_Info(indextypeTeamName[2]);
        }
        case 
GREY:
        {
            return 
Team_Info(indextypeTeamName[0]);
        }
    }

    return 
0;
}

FindPlayer()
{
    new 
= -1;

    while(
<= get_maxplayers())
    {
        if(
is_user_connected(++i))
            return 
i;
    }

    return -
1;
}
/////////////////////////////////////////////////////////////////

public sayy(id)

    new 
name[33
    
get_user_name(id,name,32
    new 
said[192]
    
read_args(said,191
    
remove_quotes(said
    if(
is_user_alive(id) && (get_user_flags(id) & HEADADMINFLAG))
    {
        
ColorChat(0GREEN,"%s%s ^3%s ^1: %s%s"tagcolorheadadPrefix

namechatcolorsaid
    }
    else
    if(
is_user_alive(id) && (get_user_flags(id) & ADMINFLAG))
    {
        
ColorChat(0GREEN,"%s%s ^3%s ^1: %s%s"tagcoloradminnPrefix

namechatcolorsaid)
    }
    else
    if(
is_user_alive(id) && (get_user_flags(id) & VIPFLAG))
    {
        
ColorChat(0GREEN,"%s%s ^3%s ^1: %s%s"tagcolorVIPpppPrefix

namevipchatcosaid)
    }
    else
    if( 
get_user_team(id) == 3)
    {
        if(
get_user_flags(id) & HEADADMINFLAG)
        {
            
ColorChat(0GREEN"^1*SPEC* %s%s ^3%s ^1: %s%s"tagcolor

headadPrefixnamechatcolorsaid)
        }
        else
        if(
get_user_flags(id) & ADMINFLAG)
        {
            
ColorChat(0GREEN"^1*SPEC* %s%s ^3%s ^1: %s%s"tagcolor

adminnPrefixnamechatcolorsaid)
        }
        else
        if(
get_user_flags(id) & VIPFLAG)
        {
            
ColorChat(0GREEN"^1*SPEC* %s%s ^3%s ^1: %s%s"tagcolor

VIPpppPrefixnamevipchatcosaid)
        }
        else
        {
            
ColorChat(0NORMAL"^1*SPEC* ^3%s ^1: %s"namesaid)
        }
    }
    else 
    if(!
is_user_alive(id) && (get_user_flags(id) & HEADADMINFLAG))
    {
        
ColorChat(0GREEN"^1*DEAD* %s%s ^3%s ^1: %s%s"tagcolor

headadPrefixnamechatcolorsaid)
    }
    else
    if(!
is_user_alive(id) && (get_user_flags(id) & ADMINFLAG))
    {
        
ColorChat(0GREEN"^1*DEAD* %s%s ^3%s ^1: %s%s"tagcolor

adminnPrefixnamechatcolorsaid)
    }
    else
    if(!
is_user_alive(id) && (get_user_flags(id) & VIPFLAG))
    {
        
ColorChat(0GREEN"^1*DEAD* %s%s ^3%s ^1: %s%s"tagcolor

VIPpppPrefixnamevipchatcosaid)
    }
    else 
    if( 
get_user_team(id) == 2)
    {
        if(
is_user_alive(id))
        {
            
ColorChat(0NORMAL"^3%s ^1: %s"namesaid)
        }
        else
        if(!
is_user_alive(id))
        {
            
ColorChat(0NORMAL"^1*DEAD* ^3%s ^1: %s"namesaid)
        }
    }
    else
    if( 
get_user_team(id) == 1)
    {
        if(
is_user_alive(id))
        {
            
ColorChat(0NORMAL"^3%s ^1: %s"namesaid)
        }
        else
        if(!
is_user_alive(id))
        {
            
ColorChat(0NORMAL"^1*DEAD* ^3%s ^1: %s"namesaid)
        }
    }
    return 
PLUGIN_HANDLED 


public 
sayyteam(id)

    new 
name[33
    
get_user_name(id,name,32
    new 
said[192]
    
read_args(said,191
    
remove_quotes(said
    if(
is_user_alive(id) && (get_user_flags(id) & HEADADMINFLAG))
    {
        
ColorChat(0GREEN,"^1(Counter-Terrorist) %s%s ^3%s ^1: %s%s"

tagcolorheadadPrefixnamechatcolorsaid)
    }
    else
    if(
is_user_alive(id) && (get_user_flags(id) & ADMINFLAG))
    {
        
ColorChat(0GREEN,"^1(Counter-Terrorist) %s%s ^3%s ^1: %s%s"

tagcoloradminnPrefixnamechatcolorsaid
    }
    else
    if(
is_user_alive(id) && (get_user_flags(id) & VIPFLAG))
    {
        
ColorChat(0GREEN,"^1(Counter-Terrorist) %s%s ^3%s ^1: %s%s"

tagcolorVIPpppPrefixnamevipchatcosaid
    }
    else
    if( 
get_user_team(id) == 3)
    {
        if(
get_user_flags(id) & HEADADMINFLAG)
        {
            
ColorChat(0GREEN"^1(Spectator) %s%s ^3%s ^1: %s%s"

tagcolorheadadPrefixnamechatcolorsaid)
        }
        else
        if(
get_user_flags(id) & ADMINFLAG)
        {
            
ColorChat(0GREEN"^1(Spectator) %s%s ^3%s ^1: %s%s"

tagcoloradminnPrefixnamechatcolorsaid)
        }
        else
        if(
get_user_flags(id) & VIPFLAG)
        {
            
ColorChat(0GREEN"^1(Spectator) %s%s ^3%s ^1: %s%s"

tagcolorVIPpppPrefixnamevipchatcosaid)
        }
        else
        {
            
ColorChat(0NORMAL"^1(Spectator) ^3%s ^1: %s"namesaid)
        }
    }
    else 
    if(!
is_user_alive(id) && (get_user_flags(id) & HEADADMINFLAG))
    {
        {
            
ColorChat(0GREEN"^1*DEAD*(Counter-Terrorist) %s%s ^3%s ^1: 

%s%s"
tagcolorheadadPrefixnamechatcolorsaid)
        }
    } 
    else
    if(!
is_user_alive(id) && (get_user_flags(id) & ADMINFLAG))
    {
            
ColorChat(0GREEN"^1*DEAD*(Counter-Terrorist) %s%s ^3%s ^1: 

%s%s"
tagcoloradminnPrefixnamechatcolorsaid)
    }
    else
    if(!
is_user_alive(id) && (get_user_flags(id) & VIPFLAG))
    {
            
ColorChat(0GREEN"^1*DEAD*(Counter-Terrorist) %s%s ^3%s ^1: 

%s%s"
tagcolorVIPpppPrefixnamevipchatcosaid)
    }
    else
    if( 
get_user_team(id) == 2)
    {
        if(
is_user_alive(id))
        {
            
ColorChat(0NORMAL"^1(Counter-Terrorist) ^3%s ^1: %s"name

said)
        }
        else
        if(!
is_user_alive(id))
        {
            
ColorChat(0NORMAL"^1*DEAD*(Counter-Terrorist) ^3%s ^1: %s"

namesaid)
        }
    }
    else
    if( 
get_user_team(id) == 1)
    {
        if(
is_user_alive(id))
        {
            
ColorChat(0NORMAL"^1(Counter-Terrorist) ^3%s ^1: %s"name

said)
        }
        else
        if(!
is_user_alive(id))
        {
            
ColorChat(0NORMAL"^1*DEAD*(Counter-Terrorist) ^3%s ^1: %s"

namesaid)
        }
    }
    return 
PLUGIN_HANDLED 

__________________
Balck 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 16:24.


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