AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [plugin] tag admin, mod & vip (https://forums.alliedmods.net/showthread.php?t=215947)

Toy0t1k 05-14-2013 10:40

[plugin] tag admin, mod & vip
 
I wish you help me in this.

SMA:
Spoiler

As appears in the server:
[ADMIN] nickname: hi
[MOD] nickname: hi
[VIP] nickname: hi

But I want this:
[ADMIN] nickname: hi <-- color: green
[MOD] nickname: hi <-- color: green
[VIP] nickname: hi <-- color: default color

Wanted the ADMIN and MOD in writing, the color of the chat was "green" and the VIP was the color "default color"

Balck 05-14-2013 12:05

Re: [plugin] tag admin, mod & vip
 
Quote:

Originally Posted by Toy0t1k (Post 1951813)
I wish you help me in this.

SMA:
Spoiler

As appears in the server:
[ADMIN] nickname: hi
[MOD] nickname: hi
[VIP] nickname: hi

But I want this:
[ADMIN] nickname: hi <-- color: green
[MOD] nickname: hi <-- color: green
[VIP] nickname: hi <-- color: default color

Wanted the ADMIN and MOD in writing, the color of the chat was "green" and the VIP was the color "default color"

You can use this you must only change this new const chatcolor[ ] = "^1" to new const chatcolor[ ] = "^4" :)

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

Toy0t1k 05-14-2013 12:17

Re: [plugin] tag admin, mod & vip
 
I want to leave the tag [ADMIN] and [MOD] with the same color, just want to change the color of the VIPS when they write.
I can change the color but if I change also changes the color of the ADMINS and MODS, which I do not want.

Just change the color of VIPS for "default color"

Do you understand me?

Balck 05-14-2013 13:06

Re: [plugin] tag admin, mod & vip
 
Quote:

Originally Posted by Toy0t1k (Post 1951875)
I want to leave the tag [ADMIN] and [MOD] with the same color, just want to change the color of the VIPS when they write.
I can change the color but if I change also changes the color of the ADMINS and MODS, which I do not want.

Just change the color of VIPS for "default color"

Do you understand me?

yes i understand you but with your sma i cant help you but i can help you with my sma i put for you [ADMIN] [MOD] and [VIP] tag if you want ?

Toy0t1k 05-14-2013 13:25

Re: [plugin] tag admin, mod & vip
 
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.

Balck 05-14-2013 14:13

Re: [plugin] tag admin, mod & vip
 
Quote:

Originally Posted by Toy0t1k (Post 1951917)
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 



Toy0t1k 05-15-2013 16:58

Re: [plugin] tag admin, mod & vip
 
There is a problem in SMA.
Players who are CT writes thus: "[HEADADMIN] banana: hi <-- where it says" banana" should appear the color of the team, which in this case is the CT team but they write the color of the team T.
I will try to fix but I doubt that can so if you can, put there.


All times are GMT -4. The time now is 16:24.

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