Русское сообщество по скриптингу

How to add admin prefixs?

Scripting help for english speaking users. While not very active, you still have a chance to get help here.
Правила форума
We cannot maintain english version version of our forum rules, but shortly (it's simple) - Don't be a dick. If you really want to know our rules you should check appropriate thread.

How to add admin prefixs?

Сообщение VenomIvanof » 07 июн 2016, 14:10

i want to add here admin prefix with white chat
/// Prefix + Flag ///
Administrator flag immunity
Server Admin flag ADMIN_KICK
V.I.P User flag "o"
SMS Admin flag "q"
Donator flag "t"

Код: Выделить всё
#include <amxmodx>
#include <amxmisc>
#include <nvault>  
#include <colorchat>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>



new Level[33], eXP[33]
new 
KillXpHsXpHeXp/*, KnifeXp*/
new gVault

new const szPrefix[] = "[^4Maina City^3] -"

#define MaxLevels 12
#define IsPlayer(%1) ( 1 <= %1 <=  g_iMaxPlayers )
#define TASK_SHOW_HUD 10113

new g_msgHudSync
new bool:is_user_ignored33 ]

new const 
Levels[MaxLevels] = 
{
   
10// 
   
50// 
   
100// 
   
200// 
   
300// 
   
600// 
   
900// 
   
1000// 
   
1500, /
   
2500//
   
3000//
   
5000 // 
}
new const 
Prefix[MaxLevels +1][] =
{
   
"Maina User"// 0
   
"Beginner"// 1
   
"Medium",  // 2
   
"Pro"// 3
   
"Killer"// 4
   
"Assassin",  // 5
   
"Soultaker"// 6
   
"Silet Killer"// 7
   
"Godlike"// 8
   
"Freak"// 9
   
"Undisputed"// 10
   
"Unstoppable"// 11
   
"Maina Pro User" // 12
}

// Bonus Stuff
new healthperlevel,
   
armorperlevel,
   
speedperlevel,
   
damageperlevel,
   
gravityperlvl
   
new g_iMaxPlayers

// ADMIN CHAT COLORS by ConnorMcLeod
enum _:ADMIN_DATAS 

    
m_szName[32], 
    
m_iFlag 
}

public 
plugin_init() 
{
   
register_plugin("Level Mod""0.0.9""Freestyle")
   
   
register_message(get_user_msgid("SayText"),"Message_SayText"); // CREDITS TO ConnorMcLeod
   
   
RegisterHam Ham_Spawn"player""Ham_CheckOthers_Bonus"1);
   
RegisterHam Ham_TakeDamage"player""Ham_CheckDamage_Bonus", .Post false );
   
RegisterHam Ham_Item_PreFrame"player""Ham_CheckSpeed_Bonus"1);
   
   
g_iMaxPlayers get_maxplayers( );
   
   
register_cvar"AdminChatColors_On""0" ); // Admin Tag - Example: [Admin] Freestyle
   
register_cvar"XP_Reward_MSG""0" ); // Message of the XP Gain
   
   // CHAT COMMANDS //
   
register_clcmd "say /xp""ShowPlayerXP")
   
register_clcmd "say_team /xp""ShowPlayerXP")
   
register_clcmd "say /level""ShowPlayerLevel")
   
register_clcmd "say_team /level""ShowPlayerLevel")
   
   
// XP SYSTEM //
   
KillXp   register_cvar("drxp_per_kill""1")
   
HsXp   register_cvar("drxp_per_hs""2")
   
HeXp   register_cvar("drxp_per_nade_kill""5")
   
//KnifeXp   = register_cvar("drxp_per_knife_kill", "5")
   
   // Give & Remove XP //
   
register_concmd "give_xp""CmdAddXP"ADMIN_RCON"<nick, #userid, authid | @all> <xp>" )
   
register_concmd "remove_xp""CmdRemoveXP"ADMIN_RCON"<nick, #userid, authid | @all> <xp>" )
   
   
/* Bonus Stuff */
   
   // Health Per Level //
   
healthperlevel   register_cvar("health_per_lvl""1")
   
   
// Armor Per Level //
   
armorperlevel   register_cvar("armor_per_lvl""1"
   
   
// Speed Per Level //
   
speedperlevel   register_cvar("speed_per_lvl""0")
   
   
// Gravity Per Level //
   
gravityperlvl   register_cvar("gravity_per_lvl""0"// NERVER MORE THAN 66 PER LVL
   
   // Damage Per Level //
   
damageperlevel   register_cvar("damage_per_lvl""1")
   
   
g_msgHudSync CreateHudSyncObj()
}

public 
plugin_cfg( )
{   
   
gVault nvault_open"DEATHRUN_XP" )
   
   if ( 
gVault == INVALID_HANDLE )
      
set_fail_state"Error opening nVault" );
}

/*      INFO ABOUT PERSONAL XP/LEVEL      */
public ShowPlayerXP(id)
{
   
ColorChat(idGREY"%s You have ^4%i^3 XP and your Level are ^4%s^3!"szPrefixeXP[id], Prefix[Level[id]])
}

public 
ShowPlayerLevel(id)
{
   new 
name[32]
   
get_user_name(idnamesizeof(name) -1)
      
   
ColorChat(idGREY"%s You are Level ^4%s^3 with ^4%i^3 XP!"szPrefixPrefix[Level[id]], eXP[id])
}

public 
Ham_CheckDamage_BonuspevVictimpevInflictorpevAttackerFloat:flDamageiDmgBits 

    if( !( 
<= pevAttacker <= g_iMaxPlayers) ) 
    { 
        return 
HAM_HANDLED
    } 
     
    if( !
is_user_alivepevAttacker )  ) 
    { 
        return 
HAM_HANDLED
    } 

    
SetHamParamFloatflDamage + ( get_pcvar_numdamageperlevel ) * LevelpevAttacker ] ) ) 

    return 
HAM_IGNORED


/*      Speed Check      */
public Ham_CheckSpeed_Bonusid )
{
   if( !
is_user_aliveid )  )
   {
      return 
HAM_IGNORED;
   }
   
   
set_user_maxspeedid250.0 + ( get_pcvar_num(speedperlevel) * Levelid ] ) );
         
   return 
HAM_IGNORED;
}

/*      HP & AP & Gravity Check      */
public Ham_CheckOthers_Bonus(id)
{
   if( !
is_user_aliveid )  )
      return 
HAM_IGNORED;
      
   
// HP Check
   
new HPCheck = ( get_user_health(id) + get_pcvar_num(healthperlevel) * Levelid ] );
   
set_user_healthidHPCheck );
   
   
// AP Check
   
new APCheck = ( get_user_armor(id) + get_pcvar_num(armorperlevel) * Levelid ] );
   
set_user_armoridAPCheck );
   
   
// Gravity
   
new GRAVITYCheck 800 - ( get_pcvar_numgravityperlvl ) * Levelid ] );
   
   if(
get_pcvar_num(gravityperlvl) > 66)
   {
      
set_user_gravityidfloat) / 800.0 );
   }
   else
   {
      
set_user_gravityidfloatGRAVITYCheck ) / 800.0 );
   }
   
   
remove_taskTASK_SHOW_HUD id );      

   
set_task(0.1"ShowHud"TASK_SHOW_HUD id)
         
   return 
HAM_IGNORED;
}

/*      XP REWARDS      */
public client_deathiKilleriVictimwpnindexhitplace )
{
   new 
vname[32]
   new 
kname[32]
   
   
get_user_nameiKillerknamecharsmaxkname ) )
   
get_user_nameiVictimvnamecharsmaxvname ) )

   if( 
is_user_ignorediKiller ] )
      return 
PLUGIN_HANDLED_MAIN
   
   get_user_name
iKillerknamecharsmaxkname ) )
   
get_user_nameiVictimvnamecharsmaxvname ) )
   
   if( 
iKiller != iVictim && ( <= iKiller <= g_iMaxPlayers ) && ( <= iVictim <= g_iMaxPlayers ) && !( hitplace == HIT_HEAD ) && !( wpnindex == CSW_HEGRENADE ) )
   {
      
eXP[iKiller] += get_pcvar_num(KillXp)
      
      if( 
get_cvar_num("XP_Reward_MSG") == 
      {
         
ColorChat iKillerGREY"%s You got^4 %i^3 XP for killing^4 %s^3"szPrefixget_pcvar_num(KillXp), vname )
      }
   }
   
   if( 
hitplace == HIT_HEAD )
   {
      
eXP[iKiller] += get_pcvar_num(HsXp)
      
      if( 
get_cvar_num("XP_Reward_MSG") == 
      {
         
ColorChat iKillerGREY"%s You got ^4%i^3 XP for killing ^4%s^3 with a ^4HeadShot"szPrefixget_pcvar_num (HsXp), vname )
      }
   }
   
   if( 
wpnindex == CSW_HEGRENADE && iKiller != iVictim )
   {
      
eXP[iKiller] += get_pcvar_num(HeXp)
      
      if( 
get_cvar_num("XP_Reward_MSG") == 
      {
         
ColorChatiKillerGREEN"%s^1 You got^4 %i^3 XP for killing^4 %s^3 with a ^4Grenade"szPrefixget_pcvar_num (HeXp), vname )
      }
   }
   
CheckLevel(iKiller)
   
SaveData(iKiller)
   
   return 
PLUGIN_CONTINUE
}

public 
CheckLevel(id)
{
   if(
Level[id] < MaxLevels-1)
   {
      while(
eXP[id] >= Levels[Level[id]])
      {
         
Level[id] += 
         ColorChat
(idGREY"%s Congratulations, you've leveled up! You are now level : ^4%i^3"szPrefixLevel[id])
      }
   } 
}

/*      HUD PERMANENT INFO      */
public ShowHud(task)
{
   new 
id task TASK_SHOW_HUD
   
   
if(!is_user_alive(id))
      return;
   
   
set_hudmessage(255000.700.9406.01.00.00.0, -1)
   
ShowSyncHudMsg(idg_msgHudSync,"••• Your Rank: %s вЂўвЂўвЂў Exp: %i вЂўвЂўвЂў"Prefix[Level[id]], eXP[id])
   
   
set_task(0.1"ShowHud"TASK_SHOW_HUD id)   
}

/*      nVault Stuff      */
public SaveData(id

   new 
AuthID[35]
   
get_user_authid(id,AuthID,34
   new 
vaultkey[64],vaultdata[256
   
   
format(vaultkey,63,"%s-Mod",AuthID
   
format(vaultdata,255,"%i#%i#",eXP[id],Level[id]) 
   
   
nvault_set(gVault,vaultkey,vaultdata
   
   return 
PLUGIN_CONTINUE 

public 
LoadData(id

   new 
AuthID[35]
   
get_user_authid(id,AuthID,34
   new 
vaultkey[64],vaultdata[256
   
   
format(vaultkey,63,"%s-Mod",AuthID
   
format(vaultdata,255,"%i#%i#",eXP[id],Level[id]) 
   
   
nvault_get(gVault,vaultkey,vaultdata,255
   
   
replace_all(vaultdata255"#"" "
   
   new 
playerxp[32], playerlevel[32
   
   
parse(vaultdataplayerxp31playerlevel31
   
   
eXP[id] = str_to_num(playerxp
   
   
Level[id] = str_to_num(playerlevel
   
   return 
PLUGIN_CONTINUE 


/*      Remove And Add XP      */
public CmdAddXP iPlayerlevelcid )
{
   if( !
cmd_accessiPlayerlevelcid) ) return PLUGIN_HANDLED;
      
   new 
arg 32 ]
   
read_argv 1arg31 
 
   new 
AddXP 32 ]
   
read_argv 2AddXPcharsmax AddXP ) )
 
   new 
XPtoGive str_to_num AddXP )
      
   new 
AdminName 32 ]
   new 
TargetName 32 ]
   
get_user_name iPlayerAdminNamecharsmax AdminName ) )
      
   if( 
arg[0]=='@' )
   { 
      if( 
equali(arg[1],"All") || equali(arg[1],"ALL") )
      {
         new 
players[32], totalplayersAll
         get_players
playerstotalplayers )
          
         for ( new 
0totalplayersi++ )
         {
            
All players]
                  
            
eXPAll ] += XPtoGive
         
}
         
         
CheckLevelAll )
         
ColorChat 0GREY"%s ^1%s^3 give^1 %i^3 XP to all ^1 players^3!"szPrefixAdminNameXPtoGive )
      }
      else if( 
equali(arg[1],"T") || equali(arg[1],"t") )
      {
         new 
players[32], totalplayersT
         get_players
playerstotalplayers )
          
         for ( new 
0totalplayersi++ )
         {
            if ( 
get_user_team(players]) == )
            {
               
players]
                     
               
eXP] += XPtoGive
            
}
         }
         
         
CheckLevel)
         
ColorChat 0GREY"%s ^1%s^3 give^1 %i^3 XP to all ^1 Terrorists^3!"szPrefixAdminNameXPtoGive )
      }
      else if( 
equali(arg[1],"CT") || equali(arg[1],"ct") )
      {
         new 
players[32], totalplayersCT
         get_players
playerstotalplayers )
          
         for( new 
0totalplayersi++ )
         {
            if( 
get_user_team(players] ) == )
            {
               
CT players]
                     
               
eXPCT ] += XPtoGive
            
}
         }
         
         
CheckLevelCT )
         
ColorChat 0GREY"%s ^1%s^3 give^1 %i^3 XP to all ^1 Counter-Terrorists^3!"szPrefixAdminNameXPtoGive )
      }
   }
   else
   {
      new 
iTarget cmd_targetiPlayerarg)
      
get_user_name iTargetTargetNamecharsmax TargetName ) )
      
      if( 
iTarget )
      {
         
eXPiTarget ] += XPtoGive
         
         CheckLevel
iTarget )
         
ColorChat 0GREY"%s ^1%s^3 give^1 %i^3 XP to^1 %s^3"szPrefixAdminNameXPtoGiveTargetName )
      }
   }
   return 
PLUGIN_HANDLED
}
 
public 
CmdRemoveXP iPlayerlevelcid )
{
   if( !
cmd_access(iPlayerlevelcid3) ) return PLUGIN_HANDLED;
      
   new 
arg 32 ]
   
read_argv 1arg31 
 
   new 
RemoveXP 32 ]
   
read_argv 2RemoveXPcharsmax RemoveXP ) )
 
   new 
XPtoRemove str_to_num RemoveXP )
      
   new 
AdminName 32 ]
   new 
TargetName 32 ]
   
get_user_name iPlayerAdminNamecharsmax AdminName ) )
      
   if( 
arg[0]=='@' )
   { 
      if( 
equali(arg[1],"All") || equali(arg[1],"ALL") )
      {
         new 
players[32], totalplayersAll
         get_players
playerstotalplayers )
          
         for ( new 
0totalplayersi++ )
         {
            
All players]
                  
            
eXPAll ] -= XPtoRemove
         
}
         
         
CheckLevelAll )
         
ColorChat 0GREY"%s ^1%s^3 toke^1 %i^3 XP of all ^1 players^3!"szPrefixAdminNameXPtoRemove )
      }
      else if( 
equali(arg[1],"T") || equali(arg[1],"t") )
      {
         new 
players[32], totalplayersT
         get_players
playerstotalplayers )
          
         for ( new 
0totalplayersi++ )
         {
            if ( 
get_user_team(players]) == )
            {
               
players]
                     
               
eXP] -= XPtoRemove
            
}
         }
         
         
CheckLevel)
         
ColorChat 0GREY"%s ^1%s^3 toke^1 %i^3 XP of all ^1 Terrorists^3!"szPrefixAdminNameXPtoRemove )
      }
      else if( 
equali(arg[1],"CT") || equali(arg[1],"ct") )
      {
         new 
players[32], totalplayersCT
         get_players
playerstotalplayers )
          
         for( new 
0totalplayersi++ )
         {
            if( 
get_user_team(players] ) == )
            {
               
CT players]
                     
               
eXPCT ] -= XPtoRemove
            
}
         }
         
         
CheckLevelCT )
         
ColorChat 0GREY"%s ^1%s^3 toke^1 %i^3 XP of all ^1 Counter-Terrorists^3!"szPrefixAdminNameXPtoRemove )
      }
   }
   else
   {
      new 
iTarget cmd_targetiPlayerarg)
      
get_user_name iTargetTargetNamecharsmax TargetName ) )
      
      if( !
iTarget )
         return 
PLUGIN_HANDLED
         
      eXP
iTarget ] -= XPtoRemove
         
      CheckLevel
iTarget )
      
ColorChat 0GREY"%s ^1%s^3 tokee^1 %i^3 XP to^1 %s^3"szPrefixAdminNameXPtoRemoveTargetName )
   }
   
   return 
PLUGIN_HANDLED
}

public 
Message_SayText(msgId,msgDest,msgEnt)
{
        new 
id get_msg_arg_int(1);
        if( 
is_user_connected(id) )
        {
                if( 
get_cvar_num("AdminChatColors_On") == )
                {
                        new 
szChannel[64]
                        
get_msg_arg_string(2szChannelcharsmax(szChannel))
 
                        if( 
equal(szChannel"#Cstrike_Chat_All") )
                        {
                                
formatex(szChannelcharsmax(szChannel), "^4[^3%s^4] ^3%%s1 ^1:  %%s2"Prefix[Level[id]])
                                
set_msg_arg_string(2szChannel)
                        }
                        else if( !
equal(szChannel"#Cstrike_Name_Change") )
                        {
                                
format(szChannelcharsmax(szChannel), "^4[^3%s^4] %s"Prefix[Level[id]], szChannel)
                                
set_msg_arg_string(2szChannel)
                        }
                        return
                }
                else
                {
                        new 
szChannel[64]
                        
get_msg_arg_string(2szChannelcharsmax(szChannel));
 
                        if( 
equal(szChannel"#Cstrike_Chat_All") )
                        {
                                
formatex(szChannelcharsmax(szChannel), "^4[^3%s^4] ^3%%s1 ^1:  %%s2"Prefix[Level[id]])
                                
set_msg_arg_string(2szChannel)
                        }
                        else if( !
equal(szChannel"#Cstrike_Name_Change") )
                        {
                                
format(szChannelcharsmax(szChannel), "^4[^3%s^4] %s"Prefix[Level[id]], szChannel)
                                
set_msg_arg_string(2szChannel)
                        }
                        return
                }
        }
}
 
Аватара пользователя
VenomIvanof
 
Сообщения: 62
Зарегистрирован: 02 апр 2016, 13:26
Благодарил (а): 17 раз.
Поблагодарили: 1 раз.
Языки программирования: Counter-Strike 1.6

Re: How to add admin prefixs?

Сообщение VenomIvanof » 07 июн 2016, 23:41

I added the prefix to admins but i have problem with the chat .. i dont get the normal rank prefix .. only the admins .. plz any help?

Код: Выделить всё
#include <amxmodx>
#include <amxmisc>
#include <nvault>  
#include <colorchat>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>

#define ACCESS_LEVEL        ADMIN_IMMUNITY
#define ADMIN_LISTEN        ADMIN_CHAT
#define HEADADMIN_CHAT_FLAG     ADMIN_LEVEL_B
#define ADMIN_CHAT_FLAG        ADMIN_LEVEL_C
#define VIP_CHAT_FLAG        ADMIN_LEVEL_H
#define SMS_CHAT_FLAG        ADMIN_LEVEL_D
#define HELP_CHAT_FLAG        ADMIN_LEVEL_A

new message[192]
new 
sayText
new teamInfo
new maxPlayers

new g_MessageColor
new g_NameColor
new g_AdminListen

new strName[191]
new 
strText[191]
new 
alive[11]



new 
Level[33], eXP[33]
new 
KillXpHsXpHeXp/*, KnifeXp*/
new gVault

new const szPrefix[] = "[^4Maina City^3] -"

#define MaxLevels 33
#define IsPlayer(%1) ( 1 <= %1 <=  g_iMaxPlayers )
#define TASK_SHOW_HUD 10113

new g_msgHudSync
new bool:is_user_ignored33 ]

new const 
g_szTag[][] = {
    
"",
    
"TEST",
    
"TET",
    
"TETETE",
    
"TETEE",
    
"tetete"
}

new const 
Levels[MaxLevels] = 
{
   
10// Starter #1
   
50// Noob #2
   
100// Beginner #3
   
200// Knifer #4
   
300// Rambo #5
   
500// Butcher #6
   
700// Matrix #7
   
900// Butcher #6
   
1000// Butcher #6
   
1100// Butcher #6
   
1500// Butcher #6
   
1600// Probhop #8
   
1700// Probhop #8
   
1800// Probhop #8
   
1900// Probhop #8
   
2000// Probhop #8
   
2100// Freak #9
   
2200// Probhop #8
   
2300// Probhop #8
   
2400// Probhop #8
   
2500// Probhop #8
   
2600// Probhop #8
   
2700// Racer #10
   
2800// Probhop #8
   
3000// Probhop #8
   
4000// Probhop #8
   
5000// Probhop #8
   
3000// Probhop #8
   
10000// Probhop #8
   
15000// Probhop #8
   
600000// Probhop #8
   
700000// Kill Bill #11
   
9999999 // Respected Player #12
}
new const 
Prefix[MaxLevels +1][] =
{
   
"Maina User"// 0
   
"Noob"// 1
   
"Bot",  // 2
   
"Beginner"// 3
   
"Learning"// 4
   
"Medium",  // 5
   
"Pro"// 6
   
"Ultra Killer"// 7
   
"Mega Killer"// 8
   
"Super Killer"// 9
   
"Unique Killer"// 10
   
"Ultimate Killer"// 11
   
"Silver Player"// 11
   
"Bronze Player"// 11
   
"Gold Player"// 11
   
"Terminator"// 11
   
"Unstoppable"// 11
   
"Night Killer"// 11
   
"Assassin"// 11
   
"Ninja"// 11
   
"Black Ninja"// 11
   
"White Nninja"// 11
   
"Sensei"// 11
   
"Freak"// 11
   
"Demonic"// 11
   
"Speeder"// 11
   
"Knifer"// 11
   
"One and Only"// 11
   
"Fantastic"// 11
   
"GOD"// 11
   
"Donator"// 11
   
"V.I.P"// 11
   
"Server Admin"// 11
   
"MC-Owner" // 12
}

// Bonus Stuff
new healthperlevel,
   
armorperlevel,
   
speedperlevel,
   
damageperlevel,
   
gravityperlvl
   
new g_iMaxPlayers

// ADMIN CHAT COLORS by ConnorMcLeod
enum _:ADMIN_DATAS 

    
m_szName[32], 
    
m_iFlag 
}

public 
plugin_init() 
{
   
register_plugin("Deathrun XP & Level Mod""0.0.9""Freestyle")
   
   
register_message(get_user_msgid("SayText"),"Message_SayText"); // CREDITS TO ConnorMcLeod
   
   
g_MessageColor register_cvar("amx_color""3"// Message colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red
   
g_NameColor register_cvar("amx_namecolor""2"// Name colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red, [6] Team-color
   
g_AdminListen register_cvar("amx_listen""0"// Set whether admins see or not all messages(Alive, dead and team-only)
   
   
sayText get_user_msgid("SayText")
   
teamInfo get_user_msgid("TeamInfo")
   
maxPlayers get_maxplayers()
   
   
register_message(sayText"avoid_duplicated")
   
register_concmd("amx_color""set_color"ACCESS_LEVEL"<color>")
   
register_concmd("amx_namecolor""set_name_color"ACCESS_LEVEL"<color>")
   
register_concmd("amx_listen""set_listen"ACCESS_LEVEL"<1 | 0>")
   
register_clcmd("say""hook_say")
   
register_clcmd("say_team""hook_teamsay")
   
   
RegisterHam Ham_Spawn"player""Ham_CheckOthers_Bonus"1);
   
RegisterHam Ham_TakeDamage"player""Ham_CheckDamage_Bonus", .Post false );
   
RegisterHam Ham_Item_PreFrame"player""Ham_CheckSpeed_Bonus"1);
   
   
g_iMaxPlayers get_maxplayers( );
   
   
register_cvar"AdminChatColors_On""0" ); // Admin Tag - Example: [Admin] Freestyle
   
register_cvar"XP_Reward_MSG""0" ); // Message of the XP Gain
   
   // CHAT COMMANDS //
   
register_clcmd "say /xp""ShowPlayerXP")
   
register_clcmd "say_team /xp""ShowPlayerXP")
   
register_clcmd "say /level""ShowPlayerLevel")
   
register_clcmd "say_team /level""ShowPlayerLevel")
   
   
// XP SYSTEM //
   
KillXp   register_cvar("drxp_per_kill""1")
   
HsXp   register_cvar("drxp_per_hs""2")
   
HeXp   register_cvar("drxp_per_nade_kill""5")
   
//KnifeXp   = register_cvar("drxp_per_knife_kill", "5")
   
   // Give & Remove XP //
   
register_concmd "give_xp""CmdAddXP"ADMIN_RCON"<nick, #userid, authid | @all> <xp>" )
   
register_concmd "remove_xp""CmdRemoveXP"ADMIN_RCON"<nick, #userid, authid | @all> <xp>" )
   
   
/* Bonus Stuff */
   
   // Health Per Level //
   
healthperlevel   register_cvar("health_per_lvl""2")
   
   
// Armor Per Level //
   
armorperlevel   register_cvar("armor_per_lvl""0"
   
   
// Speed Per Level //
   
speedperlevel   register_cvar("speed_per_lvl""0")
   
   
// Gravity Per Level //
   
gravityperlvl   register_cvar("gravity_per_lvl""0"// NERVER MORE THAN 66 PER LVL
   
   // Damage Per Level //
   
damageperlevel   register_cvar("damage_per_lvl""1")
   
   
g_msgHudSync CreateHudSyncObj()
}

public 
avoid_duplicated(msgIdmsgDestreceiver)
{
    return 
PLUGIN_HANDLED
}
public 
hook_say(id)
{
    
read_args(message191)
    
remove_quotes(message)
    
    
// Gungame commands and empty messages
    
if(message[0] == '@' || message[0] == '/' || message[0] == '!' || message[0] == '#' || message[0] == '$' || equal(message"")) // Ignores Admin Hud Messages, Admin Slash commands
    
return PLUGIN_CONTINUE
    
    
new name[32]
    
get_user_name(idname31)
    new 
admin 0iFlags get_user_flags(id)
    
    if(
iFlags HEADADMIN_CHAT_FLAG)
    
admin 1
            
else if(iFlags ADMIN_CHAT_FLAG)
                
admin 2
        
else if(iFlags VIP_CHAT_FLAG)
                
admin 3
        
else if(iFlags SMS_CHAT_FLAG)
                
admin 4
        
else if(iFlags HELP_CHAT_FLAG)
                
admin 5
     
new isAlive

        
if(is_user_alive(id))
        {
                
isAlive 1
                alive 
"^x01"
        
}
        else
        {
                
isAlive 0
                alive 
"^x01*DEAD* "
        
}

        static 
color[10]

        if(
admin)
        {
                
// Name
                
switch(get_pcvar_num(g_NameColor))
                {
                        case 
1:
                                
format(strName191"^x03%s %s%s"g_szTag[admin], alivename)
                        case 
2:
                                
format(strName191"^x03%s %s^x04%s "g_szTag[admin], alivename)
                        case 
3:
                        {
                                
color "SPECTATOR"
                                
format(strName191"^x03%s %s^x03%s "g_szTag[admin], alivename)
                        }
                        case 
4:
                        {
                                
color "CT"
                                
format(strName191"^x03%s %s^x03%s"g_szTag[admin], alivename)
                        }
                        case 
5:
                        {
                                
color "TERRORIST"
                                
format(strName191"^x03%s %s^x03%s"g_szTag[admin], alivename)
                        }
                        case 
6:
                        {
                                
get_user_team(idcolor9)
                                
format(strName191"^x03%s %s^x03%s"g_szTag[admin], alivename)
                        }
                }

                
// Message
                
switch(get_pcvar_num(g_MessageColor))
                {
                        case 
1:    // Yellow
                                
format(strText191"^x03%s"message)
                        case 
2:    // Green
                                
format(strText191"^x03%s"message)
                        case 
3:    // White
                        
{
                                
copy(color9"SPECTATOR")
                                
format(strText191"^x03%s"message)
                        }
                        case 
4:    // Blue
                        
{
                                
copy(color9"CT")
                                
format(strText191"^x03%s"message)
                        }
                        case 
5:    // Red
                        
{
                                
copy(color9"TERRORIST")
                                
format(strText191"^x03%s"message)
                        }
                }
        }
        else     
// Player is not admin. Team-color name : Yellow message
        
{
                
get_user_team(idcolor9)
                
format(strName191"%s^x03%s"alivename)
                
format(strText191"%s"message)
        }

        
format(message191"%s^x01 :  %s"strNamestrText)

        
sendMessage(colorisAlive)    // Sends the colored message

        
return PLUGIN_CONTINUE
}


public 
hook_teamsay(id)
{
        new 
playerTeam get_user_team(id)
        new 
playerTeamName[19]

        switch(
playerTeam// Team names which appear on team-only messages
        
{
                case 
1:
                        
copy(playerTeamName11"Terrorists")

                case 
2:
                        
copy(playerTeamName18"Counter-Terrorists")

                default:
                        
copy(playerTeamName9"Spectator")
        }

        
read_args(message191)
        
remove_quotes(message)

        
// Gungame commands and empty messages
        
if(message[0] == '@' || message[0] == '/' || message[0] == '!' || message[0] == '#' || message[0] == '$' || equal(message"")) // Ignores Admin Hud Messages, Admin Slash commands
                
return PLUGIN_CONTINUE

        
new name[32]
        
get_user_name(idname31)

        new 
admin 0iFlags get_user_flags(id)

        if(
iFlags HEADADMIN_CHAT_FLAG)
                
admin 1
        
else if(iFlags ADMIN_CHAT_FLAG)
                
admin 2
        
else if(iFlags VIP_CHAT_FLAG)
                
admin 3
        
else if(iFlags SMS_CHAT_FLAG)
                
admin 4
        
else if(iFlags HELP_CHAT_FLAG)
                
admin 5

        
new isAlive

        
if(is_user_alive(id))
        {
                
isAlive 1
                alive 
"^x01"
        
}
        else
        {
                
isAlive 0
                alive 
"^x01*DEAD* "
        
}

        static 
color[10]

        if(
admin)
        {
                
// Name
                
switch(get_pcvar_num(g_NameColor))
                {
                        case 
1:
                                
format(strName191"%s(%s) ^x03%s %s"aliveplayerTeamNameg_szTag[admin], name)
                        case 
2:
                                
format(strName191"%s(%s) ^x03%s ^x04%s"aliveplayerTeamNameg_szTag[admin], name)
                        case 
3:
                        {
                                
color "SPECTATOR"
                                
format(strName191"%s(%s) ^x03%s ^x03%s"aliveplayerTeamNameg_szTag[admin], name)
                        }
                        case 
4:
                        {
                                
color "CT"
                                
format(strName191"%s(%s) ^x03%s ^x03%s"aliveplayerTeamNameg_szTag[admin], name)
                        }
                        case 
5:
                        {
                                
color "TERRORIST"
                                
format(strName191"%s(%s) ^x03%s ^x03%s"aliveplayerTeamNameg_szTag[admin], name)
                        }
                        case 
6:
                        {
                                
get_user_team(idcolor9)
                                
format(strName191"%s(%s) ^x03%s ^x03%s"aliveplayerTeamNameg_szTag[admin], name)
                        }
                }

                
// Message
                
switch(get_pcvar_num(g_MessageColor))
                {
                        case 
1:    // Yellow
                                
format(strText191"^x03%s"message)
                        case 
2:    // Green
                                
format(strText191"^x03%s"message)
                        case 
3:    // White
                        
{
                                
copy(color9"SPECTATOR")
                                
format(strText191"^x03%s"message)
                        }
                        case 
4:    // Blue
                        
{
                                
copy(color9"CT")
                                
format(strText191"^x03%s"message)
                        }
                        case 
5:    // Red
                        
{
                                
copy(color9"TERRORIST")
                                
format(strText191"^x03%s"message)
                        }
                }
        }
        else     
// Player is not admin. Team-color name : Yellow message
        
{
                
get_user_team(idcolor9)
                
format(strName191"%s(%s) ^x03%s"aliveplayerTeamNamename)
                
format(strText191"%s"message)
        }

        
format(message191"%s ^x01:  %s"strNamestrText)

        
sendTeamMessage(colorisAliveplayerTeam)    // Sends the colored message

        
return PLUGIN_CONTINUE
}


public 
set_color(idlevelcid)
{
        if(!
cmd_access(idlevelcid2))
                return 
PLUGIN_HANDLED

        
new arg[1], newColor
        read_argv
(1arg1)

        
newColor str_to_num(arg)

        if(
newColor >= && newColor <= 5)
        {
                
set_pcvar_num(g_MessageColornewColor)

                if(
get_pcvar_num(g_NameColor) != &&
                        ((
newColor == &&  get_pcvar_num(g_NameColor) != 3)
                        ||(
newColor == &&  get_pcvar_num(g_NameColor) != 4)
                        ||(
newColor == &&  get_pcvar_num(g_NameColor) != 5)))
                {
                        
set_pcvar_num(g_NameColor2)
                }
        }

        return 
PLUGIN_HANDLED
}


public 
set_name_color(idlevelcid)
{
        if(!
cmd_access(idlevelcid2))
                return 
PLUGIN_HANDLED

        
new arg[1], newColor
        read_argv
(1arg1)

        
newColor str_to_num(arg)

        if(
newColor >= && newColor <= 6)
        {
                
set_pcvar_num(g_NameColornewColor)

                if((
get_pcvar_num(g_MessageColor) != 1
                        
&&((newColor == &&  get_pcvar_num(g_MessageColor) != 3)
                        ||(
newColor == &&  get_pcvar_num(g_MessageColor) != 4)
                        ||(
newColor == &&  get_pcvar_num(g_MessageColor) != 5)))
                        || 
get_pcvar_num(g_NameColor) == 6)
                {
                        
set_pcvar_num(g_MessageColor2)
                }
        }

        return 
PLUGIN_HANDLED
}


public 
set_listen(idlevelcid)
{
        if(!
cmd_access(idlevelcid2))
                return 
PLUGIN_HANDLED

        
new arg[1], newListen
        read_argv
(1arg1)

        
newListen str_to_num(arg)

        
set_pcvar_num(g_AdminListennewListen)

        return 
PLUGIN_HANDLED
}


public 
sendMessage(color[], alive)
{
        new 
teamName[10]

        for(new 
player 1player maxPlayersplayer++)
        {
                if(!
is_user_connected(player))
                        continue

                if(
alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
                {
                        
get_user_team(playerteamName9)    // Stores user's team name to change back after sending the message
                        
changeTeamInfo(playercolor)        // Changes user's team according to color choosen
                        
writeMessage(playermessage)        // Writes the message on player's chat
                        
changeTeamInfo(playerteamName)    // Changes user's team back to original
                
}
        }
}


public 
sendTeamMessage(color[], aliveplayerTeam)
{
        new 
teamName[10]

        for(new 
player 1player maxPlayersplayer++)
        {
                if(!
is_user_connected(player))
                        continue

                if(
get_user_team(player) == playerTeam || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
                {
                        if(
alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
                        {
                                
get_user_team(playerteamName9)    // Stores user's team name to change back after sending the message
                                
changeTeamInfo(playercolor)        // Changes user's team according to color choosen
                                
writeMessage(playermessage)        // Writes the message on player's chat
                                
changeTeamInfo(playerteamName)    // Changes user's team back to original
                        
}
                }
        }
}


public 
changeTeamInfo(playerteam[])
{
        
message_begin(MSG_ONEteamInfo_player)    // Tells to to modify teamInfo(Which is responsable for which time player is)
        
write_byte(player)                // Write byte needed
        
write_string(team)                // Changes player's team
        
message_end()                    // Also Needed
}


public 
writeMessage(playermessage[])
{
        
message_begin(MSG_ONEsayText, {000}, player)    // Tells to modify sayText(Which is responsable for writing colored messages)
        
write_byte(player)                    // Write byte needed
        
write_string(message)                    // Effectively write the message, finally, afterall
        
message_end()                        // Needed as always
}
    

public 
plugin_cfg( )
{   
   
gVault nvault_open"DEATHRUN_XP" )
   
   if ( 
gVault == INVALID_HANDLE )
      
set_fail_state"Error opening nVault" );
}

/*      INFO ABOUT PERSONAL XP/LEVEL      */
public ShowPlayerXP(id)
{
   
ColorChat(idGREY"%s You have ^4%i^3 XP and your Level are ^4%s^3!"szPrefixeXP[id], Prefix[Level[id]])
}

public 
ShowPlayerLevel(id)
{
   new 
name[32]
   
get_user_name(idnamesizeof(name) -1)
      
   
ColorChat(idGREY"%s You are Level ^4%s^3 with ^4%i^3 XP!"szPrefixPrefix[Level[id]], eXP[id])
}

public 
Ham_CheckDamage_BonuspevVictimpevInflictorpevAttackerFloat:flDamageiDmgBits 

    if( !( 
<= pevAttacker <= g_iMaxPlayers) ) 
    { 
        return 
HAM_HANDLED
    } 
     
    if( !
is_user_alivepevAttacker )  ) 
    { 
        return 
HAM_HANDLED
    } 

    
SetHamParamFloatflDamage + ( get_pcvar_numdamageperlevel ) * LevelpevAttacker ] ) ) 

    return 
HAM_IGNORED


/*      Speed Check      */
public Ham_CheckSpeed_Bonusid )
{
   if( !
is_user_aliveid )  )
   {
      return 
HAM_IGNORED;
   }
   
   
set_user_maxspeedid250.0 + ( get_pcvar_num(speedperlevel) * Levelid ] ) );
         
   return 
HAM_IGNORED;
}

/*      HP & AP & Gravity Check      */
public Ham_CheckOthers_Bonus(id)
{
   if( !
is_user_aliveid )  )
      return 
HAM_IGNORED;
      
   
// HP Check
   
new HPCheck = ( get_user_health(id) + get_pcvar_num(healthperlevel) * Levelid ] );
   
set_user_healthidHPCheck );
   
   
// AP Check
   
new APCheck = ( get_user_armor(id) + get_pcvar_num(armorperlevel) * Levelid ] );
   
set_user_armoridAPCheck );
   
   
// Gravity
   
new GRAVITYCheck 800 - ( get_pcvar_numgravityperlvl ) * Levelid ] );
   
   if(
get_pcvar_num(gravityperlvl) > 66)
   {
      
set_user_gravityidfloat) / 800.0 );
   }
   else
   {
      
set_user_gravityidfloatGRAVITYCheck ) / 800.0 );
   }
   
   
remove_taskTASK_SHOW_HUD id );      

   
set_task(0.1"ShowHud"TASK_SHOW_HUD id)
         
   return 
HAM_IGNORED;
}

/*      XP REWARDS      */
public client_deathiKilleriVictimwpnindexhitplace )
{
   new 
vname[32]
   new 
kname[32]
   
   
get_user_nameiKillerknamecharsmaxkname ) )
   
get_user_nameiVictimvnamecharsmaxvname ) )

   if( 
is_user_ignorediKiller ] )
      return 
PLUGIN_HANDLED_MAIN
   
   get_user_name
iKillerknamecharsmaxkname ) )
   
get_user_nameiVictimvnamecharsmaxvname ) )
   
   if( 
iKiller != iVictim && ( <= iKiller <= g_iMaxPlayers ) && ( <= iVictim <= g_iMaxPlayers ) && !( hitplace == HIT_HEAD ) && !( wpnindex == CSW_HEGRENADE ) )
   {
      
eXP[iKiller] += get_pcvar_num(KillXp)
      
      if( 
get_cvar_num("XP_Reward_MSG") == 
      {
         
ColorChat iKillerGREY"%s You got^4 %i^3 XP for killing^4 %s^3"szPrefixget_pcvar_num(KillXp), vname )
      }
   }
   
   if( 
hitplace == HIT_HEAD )
   {
      
eXP[iKiller] += get_pcvar_num(HsXp)
      
      if( 
get_cvar_num("XP_Reward_MSG") == 
      {
         
ColorChat iKillerGREY"%s You got ^4%i^3 XP for killing ^4%s^3 with a ^4HeadShot"szPrefixget_pcvar_num (HsXp), vname )
      }
   }
   
   if( 
wpnindex == CSW_HEGRENADE && iKiller != iVictim )
   {
      
eXP[iKiller] += get_pcvar_num(HeXp)
      
      if( 
get_cvar_num("XP_Reward_MSG") == 
      {
         
ColorChatiKillerGREEN"%s^1 You got^4 %i^3 XP for killing^4 %s^3 with a ^4Grenade"szPrefixget_pcvar_num (HeXp), vname )
      }
   }
   
CheckLevel(iKiller)
   
SaveData(iKiller)
   
   return 
PLUGIN_CONTINUE
}

public 
CheckLevel(id)
{
   if(
Level[id] < MaxLevels-1)
   {
      while(
eXP[id] >= Levels[Level[id]])
      {
         
Level[id] += 
         ColorChat
(idGREY"%s Congratulations, you've leveled up! You are now level : ^4%i^3"szPrefixLevel[id])
      }
   } 
}

/*      HUD PERMANENT INFO      */
public ShowHud(task)
{
   new 
id task TASK_SHOW_HUD
   
   
if(!is_user_alive(id))
      return;
   
   
set_hudmessage(301442550.670.9406.01.00.00.0, -1)
   
ShowSyncHudMsg(idg_msgHudSync,"•• Rank: %s •• Exp: %i •• Level: %i ••"Prefix[Level[id]], eXP[id], Level[id])
   
   
set_task(0.1"ShowHud"TASK_SHOW_HUD id)   
}

/*      nVault Stuff      */
public SaveData(id

   new 
AuthID[35]
   
get_user_authid(id,AuthID,34
   new 
vaultkey[64],vaultdata[256
   
   
format(vaultkey,63,"%s-Mod",AuthID
   
format(vaultdata,255,"%i#%i#",eXP[id],Level[id]) 
   
   
nvault_set(gVault,vaultkey,vaultdata
   
   return 
PLUGIN_CONTINUE 

public 
LoadData(id

   new 
AuthID[35]
   
get_user_authid(id,AuthID,34
   new 
vaultkey[64],vaultdata[256
   
   
format(vaultkey,63,"%s-Mod",AuthID
   
format(vaultdata,255,"%i#%i#",eXP[id],Level[id]) 
   
   
nvault_get(gVault,vaultkey,vaultdata,255
   
   
replace_all(vaultdata255"#"" "
   
   new 
playerxp[32], playerlevel[32
   
   
parse(vaultdataplayerxp31playerlevel31
   
   
eXP[id] = str_to_num(playerxp
   
   
Level[id] = str_to_num(playerlevel
   
   return 
PLUGIN_CONTINUE 


/*      Remove And Add XP      */
public CmdAddXP iPlayerlevelcid )
{
   if( !
cmd_accessiPlayerlevelcid) ) return PLUGIN_HANDLED;
      
   new 
arg 32 ]
   
read_argv 1arg31 
 
   new 
AddXP 32 ]
   
read_argv 2AddXPcharsmax AddXP ) )
 
   new 
XPtoGive str_to_num AddXP )
      
   new 
AdminName 32 ]
   new 
TargetName 32 ]
   
get_user_name iPlayerAdminNamecharsmax AdminName ) )
      
   if( 
arg[0]=='@' )
   { 
      if( 
equali(arg[1],"All") || equali(arg[1],"ALL") )
      {
         new 
players[32], totalplayersAll
         get_players
playerstotalplayers )
          
         for ( new 
0totalplayersi++ )
         {
            
All players]
                  
            
eXPAll ] += XPtoGive
         
}
         
         
CheckLevelAll )
         
ColorChat 0GREY"%s ^1%s^3 give^1 %i^3 XP to all ^1 players^3!"szPrefixAdminNameXPtoGive )
      }
      else if( 
equali(arg[1],"T") || equali(arg[1],"t") )
      {
         new 
players[32], totalplayersT
         get_players
playerstotalplayers )
          
         for ( new 
0totalplayersi++ )
         {
            if ( 
get_user_team(players]) == )
            {
               
players]
                     
               
eXP] += XPtoGive
            
}
         }
         
         
CheckLevel)
         
ColorChat 0GREY"%s ^1%s^3 give^1 %i^3 XP to all ^1 Terrorists^3!"szPrefixAdminNameXPtoGive )
      }
      else if( 
equali(arg[1],"CT") || equali(arg[1],"ct") )
      {
         new 
players[32], totalplayersCT
         get_players
playerstotalplayers )
          
         for( new 
0totalplayersi++ )
         {
            if( 
get_user_team(players] ) == )
            {
               
CT players]
                     
               
eXPCT ] += XPtoGive
            
}
         }
         
         
CheckLevelCT )
         
ColorChat 0GREY"%s ^1%s^3 give^1 %i^3 XP to all ^1 Counter-Terrorists^3!"szPrefixAdminNameXPtoGive )
      }
   }
   else
   {
      new 
iTarget cmd_targetiPlayerarg)
      
get_user_name iTargetTargetNamecharsmax TargetName ) )
      
      if( 
iTarget )
      {
         
eXPiTarget ] += XPtoGive
         
         CheckLevel
iTarget )
         
ColorChat 0GREY"%s ^1%s^3 give^1 %i^3 XP to^1 %s^3"szPrefixAdminNameXPtoGiveTargetName )
      }
   }
   return 
PLUGIN_HANDLED
}
 
public 
CmdRemoveXP iPlayerlevelcid )
{
   if( !
cmd_access(iPlayerlevelcid3) ) return PLUGIN_HANDLED;
      
   new 
arg 32 ]
   
read_argv 1arg31 
 
   new 
RemoveXP 32 ]
   
read_argv 2RemoveXPcharsmax RemoveXP ) )
 
   new 
XPtoRemove str_to_num RemoveXP )
      
   new 
AdminName 32 ]
   new 
TargetName 32 ]
   
get_user_name iPlayerAdminNamecharsmax AdminName ) )
      
   if( 
arg[0]=='@' )
   { 
      if( 
equali(arg[1],"All") || equali(arg[1],"ALL") )
      {
         new 
players[32], totalplayersAll
         get_players
playerstotalplayers )
          
         for ( new 
0totalplayersi++ )
         {
            
All players]
                  
            
eXPAll ] -= XPtoRemove
         
}
         
         
CheckLevelAll )
         
ColorChat 0GREY"%s ^1%s^3 toke^1 %i^3 XP of all ^1 players^3!"szPrefixAdminNameXPtoRemove )
      }
      else if( 
equali(arg[1],"T") || equali(arg[1],"t") )
      {
         new 
players[32], totalplayersT
         get_players
playerstotalplayers )
          
         for ( new 
0totalplayersi++ )
         {
            if ( 
get_user_team(players]) == )
            {
               
players]
                     
               
eXP] -= XPtoRemove
            
}
         }
         
         
CheckLevel)
         
ColorChat 0GREY"%s ^1%s^3 toke^1 %i^3 XP of all ^1 Terrorists^3!"szPrefixAdminNameXPtoRemove )
      }
      else if( 
equali(arg[1],"CT") || equali(arg[1],"ct") )
      {
         new 
players[32], totalplayersCT
         get_players
playerstotalplayers )
          
         for( new 
0totalplayersi++ )
         {
            if( 
get_user_team(players] ) == )
            {
               
CT players]
                     
               
eXPCT ] -= XPtoRemove
            
}
         }
         
         
CheckLevelCT )
         
ColorChat 0GREY"%s ^1%s^3 toke^1 %i^3 XP of all ^1 Counter-Terrorists^3!"szPrefixAdminNameXPtoRemove )
      }
   }
   else
   {
      new 
iTarget cmd_targetiPlayerarg)
      
get_user_name iTargetTargetNamecharsmax TargetName ) )
      
      if( !
iTarget )
         return 
PLUGIN_HANDLED
         
      eXP
iTarget ] -= XPtoRemove
         
      CheckLevel
iTarget )
      
ColorChat 0GREY"%s ^1%s^3 tokee^1 %i^3 XP to^1 %s^3"szPrefixAdminNameXPtoRemoveTargetName )
   }
   
   return 
PLUGIN_HANDLED
}

public 
Message_SayText(msgId,msgDest,msgEnt)
{
        new 
id get_msg_arg_int(1);
        if( 
is_user_connected(id) )
        {
                if( 
get_cvar_num("AdminChatColors_On") == )
                {
                        new 
szChannel[64]
                        
get_msg_arg_string(2szChannelcharsmax(szChannel))
 
                        if( 
equal(szChannel"#Cstrike_Chat_All") )
                        {
                                
formatex(szChannelcharsmax(szChannel), "^4[^3%s^4] ^3%%s1 ^1:  %%s2"Prefix[Level[id]])
                                
set_msg_arg_string(2szChannel)
                        }
                        else if( !
equal(szChannel"#Cstrike_Name_Change") )
                        {
                                
format(szChannelcharsmax(szChannel), "^4[^3%s^4] %s"Prefix[Level[id]], szChannel)
                                
set_msg_arg_string(2szChannel)
                        }
                        return
                }
                else
                {
                        new 
szChannel[64]
                        
get_msg_arg_string(2szChannelcharsmax(szChannel));
 
                        if( 
equal(szChannel"#Cstrike_Chat_All") )
                        {
                                
formatex(szChannelcharsmax(szChannel), "^4[^3%s^4] ^3%%s1 ^1:  %%s2"Prefix[Level[id]])
                                
set_msg_arg_string(2szChannel)
                        }
                        else if( !
equal(szChannel"#Cstrike_Name_Change") )
                        {
                                
format(szChannelcharsmax(szChannel), "^4[^3%s^4] %s"Prefix[Level[id]], szChannel)
                                
set_msg_arg_string(2szChannel)
                        }
                        return
                }
        }
}
 
Аватара пользователя
VenomIvanof
 
Сообщения: 62
Зарегистрирован: 02 апр 2016, 13:26
Благодарил (а): 17 раз.
Поблагодарили: 1 раз.
Языки программирования: Counter-Strike 1.6

Re: How to add admin prefixs?

Сообщение RevCrew » 08 июн 2016, 18:29

Skype revcrew77
https://vk.com/cs_suite_ru - создал группу в вк
CS-Suite
Аватара пользователя
RevCrew
Скриптер
 
Сообщения: 1190
Зарегистрирован: 15 июл 2013, 20:45
Благодарил (а): 219 раз.
Поблагодарили: 225 раз.
Языки программирования: Counter-Strike 1.6

Re: How to add admin prefixs?

Сообщение VenomIvanof » 08 июн 2016, 20:14

RevCrew писал(а):VenomIvanof, I give you website that help you but it russian
Вы должны зарегистрироваться, чтобы видеть ссылки.


i understand what is the point .. but this is little different admin chat + prefix it use only grey and green color

however i cant figure out how to edit the plugin to work right ... if you have free time try to fix it.
Аватара пользователя
VenomIvanof
 
Сообщения: 62
Зарегистрирован: 02 апр 2016, 13:26
Благодарил (а): 17 раз.
Поблагодарили: 1 раз.
Языки программирования: Counter-Strike 1.6


Вернуться в Scripting

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1