Thread: [Solved] Scoreboard TAG
View Single Post
Author Message
stevsonn
Junior Member
Join Date: Nov 2017
Old 01-20-2019 , 13:18   Scoreboard TAG
Reply With Quote #1

Hello! Can anyone make the VIP tag show on the scoreboard for players in this plugin?

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <clientprefs>

#define VIP_FLAG ADMFLAG_CUSTOM6

HandleArmor
Handle
Helmet
Handle
Bhop
Handle
Defuser
Handle
VipSpeed
Handle
SpeedAmmount
Handle
Damage
Handle
DamageAmount
Handle
HE 
Handle
Flash
Handle
Molotov
Handle
Smoke
Handle
PistolRoundRule
Handle
HpNormalKill
Handle
HpKnifeKill
Handle
HpHeadShotKill
Handle
MaxHP
Handle
MoneyPerNormalKill
Handle
MoneyPerKnifeKill
Handle
MoneyPerHeadShotKill
Handle
ExtraMoneyOnSpawn
Handle
ShowBombsite
Handle
HalfPlantTime
Handle
HalfDefuseTimeNoKit
Handle
HalfDefuseTimeKit
Handle
Notify

new HandleBhopCookie INVALID_HANDLE

new MoneyOffset = -1
new RoundID 0

bool
CanBhopMAXPLAYERS ]
boolIsPistolRound false

public Plugin:myinfo = {
    
name "CS:GO VIP",
    
author "tre3fla",
    
description "VIP pentru serverele de csgo",
    
version "1.2",
    
url "http://extreamcs.com/forum"
}

public 
OnPluginStart( ) {
    
Armor CreateConVar"vip_give_armor""1""VIP primeste 100 armura la spawn" )
    
Helmet CreateConVar"vip_give_helmet""1""VIP primeste helmet daca are armura" )
    
Bhop CreateConVar"vip_autobhop""0""VIP poate face bhop automat cand tine apasat space" )
    
Defuser CreateConVar"vip_give_ct_defuser""1""VIP primeste defuser atunci cand este CT" )
    
VipSpeed CreateConVar"vip_fast_speed""0""VIP primeste viteza de miscare mai mare" )
    
SpeedAmmount CreateConVar"vip_speed_amount""1.2""Cat de rapid sa se miste VIP" )
    
Damage CreateConVar"vip_high_damage""0""VIP va avea damage mai mare" )
    
DamageAmount CreateConVar"vip_damage_amount""2""Cu cat sa fie multiplicat damage-ul vipului" )
    
HE CreateConVar"vip_give_he""1""VIP primeste un HE la spawn, daca nu are deja unul" )
    
Flash CreateConVar"vip_give_flash""1""VIP primeste un flash la spawn, daca nu are deja unul" )
    
Molotov CreateConVar"vip_give_molotov""1""VIP primeste molotov la spawn daca nu are deja unul" )
    
Smoke CreateConVar"vip_give_smoke""1""VIP primeste smoke la spawn daca nu are deja unul" )
    
PistolRoundRule CreateConVar"vip_disabled_on_pistol_round""0""VIP nu va rula un in rundele de pistoale pe competitive" )
    
ExtraMoneyOnSpawn CreateConVar"vip_give_money_on_spawn""0""VIP va primi aceea suma de bani la spawn. 0=dezactivat" 
    
HpNormalKill CreateConVar"vip_normal_kill_hp""5""VIP va primi HP cand face frag" )
    
HpKnifeKill CreateConVar"vip_knife_kill_hp""5""VIP va primi HP cand face frag cu cutitul" )
    
HpHeadShotKill CreateConVar"vip_headshot_hp""10""VIP va primit HP cand face frag cu headshot" )
    
MaxHP CreateConVar"vip_max_hp""130""HP-ul maxim pe care il poate avea un VIP" )
    
MoneyPerNormalKill CreateConVar"vip_normal_kill_money""0""VIP va primi acea suma de bani cand face frag" )
    
MoneyPerKnifeKill CreateConVar"vip_knife_kill_money""0""VIP va primi acea suma de bani cand face frag cu cutitul" )
    
MoneyPerHeadShotKill CreateConVar"vip_headshot_kill_money""0""VIP va primi acea suma de bani cand face frag cu headshot" )
    
ShowBombsite CreateConVar"vip_show_bombsite""1""VIP de la ct vor vedea in ce bombsite au plantat teroristii bomba" )
    
HalfPlantTime CreateConVar"vip_bomb_plant_time""2""Timp in secunde pentru plantarea bombei de catre VIP" )
    
HalfDefuseTimeNoKit CreateConVar"vip_defuse_time_nokit""5""Timp necesar pentru ca VIP sa dea defuse bombei cand nu are kit" )
    
HalfDefuseTimeKit CreateConVar"vip_defuse_time_kit""2.5""Timp necesar pentru ca VIP sa dea defuse bombei cand are kit" )
    
Notify CreateConVar"vip_notify_on_bonus""1""VIP vor vedea mesaje in chat cand primesc hp, bani, etc" )

    
MoneyOffset FindSendPropInfo"CCSPlayer""m_iAccount" )

    
RegConsoleCmd"bhop"Command_ToggleBhop )
    
RegConsoleCmd"vips"Command_ShowVips )

    
BhopCookie RegClientCookie"AutoBhop""Cookie AutoBhop"CookieAccess_Protected )

    
HookEvent"player_spawn"Event_PlayerSpawn )
    
HookEvent"player_death"Event_PlayerDeath )
    
HookEvent"announce_phase_end"Event_PhaseEnd )
    
HookEvent"bomb_planted"Event_BombPlanted )

    
HookEventEx"bomb_begindefuse"Event_BeginDefuse )
    
HookEventEx"bomb_beginplant"Event_BeginPlant )

    
HookEvent"round_end"Event_RoundEndEventHookMode_PostNoCopy )
}

public 
OnMapStart( ) {
    
RoundID 0
    IsPistolRound 
false
}

public 
OnClientCookiesCachedclient ) {
    
decl StringUserCookie]
    
GetClientCookieclientBhopCookieUserCookiesizeofUserCookie ) )

    if( 
StrEqualUserCookie"1" ) && IsClientVipclient ) ) {
        
CanBhopclient ] = true
    
}
    else {
        
CanBhopclient ] = false
        SetClientCookie
clientBhopCookie"0" )
    }
}

public 
OnClientPutInServerclient ) {
    
SDKHookclientSDKHook_WeaponSwitchPostWeaponSwitchPost )
    
SDKHookclientSDKHook_OnTakeDamageOnTakeDamage )
}

public 
ActionEvent_PlayerSpawnHandleevent, const Stringname[ ], booldontBroadcast ) { 
    if( 
GetConVarBoolPistolRoundRule ) && IsPistolRound ) {
        return 
Plugin_Handled
    


    new 
client GetClientOfUserIdGetEventIntevent"userid" ) )

    if( 
client && client MaxClients && IsClientInGameclient ) && IsPlayerAliveclient ) && !IsFakeClientclient ) ) {
        if( 
IsClientVipclient ) ) {
            
RemoveClientGrenadesclient )
            
RequestFrameGiveSpawnItemsclient )
        }
    }
    return 
Plugin_Continue
}

public 
ActionEvent_PlayerDeathHandleevent, const Stringname[ ], booldontBroadcast ) {
    if( 
GetConVarBoolPistolRoundRule ) && IsPistolRound ) {
        return 
Plugin_Handled
    


    new 
victim GetClientOfUserIdGetEventIntevent"userid" ) )
    new 
attacker GetClientOfUserIdGetEventIntevent"attacker" ) )

    if( 
attacker && attacker MaxClients && IsClientInGameattacker ) && victim && victim MaxClients && IsClientInGamevictim ) && IsClientVipattacker ) && attacker != victim ) {
        new 
bool:Headshot GetEventBoolevent"headshot" )

        
char Arma64 ]
        
GetEventStringevent"weapon"ArmasizeofArma ) )

        if( 
Headshot ) {
            if( 
GetConVarIntMoneyPerHeadShotKill ) > && MoneyOffset != -) {
                
SetEntPropattackerProp_Send"m_iAccount"GetEntPropattackerProp_Send"m_iAccount" ) + GetConVarIntMoneyPerHeadShotKill ) )

                if( 
GetConVarBoolNotify ) ) {
                    
PrintToChatattacker" \x04[VIP]\x10 Sikeresen kaptál extrát\x06 $%d\x10 mert megöltél egy ellenséget!"GetConVarIntMoneyPerHeadShotKill ) )
                }
            }

            if( 
GetConVarIntHpHeadShotKill ) > && GetClientHealthattacker ) < GetConVarIntMaxHP ) ) {
                new 
ClientHealth GetClientHealthattacker )
                
ClientHealth += GetConVarIntHpHeadShotKill )

                if( 
ClientHealth GetConVarIntMaxHP ) ) {
                    
ClientHealth GetConVarIntMaxHP 
                }

                
SetEntPropattackerProp_Data"m_iHealth"ClientHealth )

                if( 
GetConVarBoolNotify ) ) {
                    
PrintToChatattacker" \x04[VIP]\x10 Sikeresen kaptál\x06 %d életerőt\x10 mert megöltél egy ellenséget!"GetConVarIntHpHeadShotKill ) )
                }                    
            }
        }
        else if( ( 
StrContainsArma"knife"false ) != -) || ( StrContainsArma"bayonet"false ) != -) ) {
            if( 
GetConVarIntMoneyPerKnifeKill ) > && MoneyOffset != -) {
                
SetEntPropattackerProp_Send"m_iAccount"GetEntPropattackerProp_Send"m_iAccount" ) + GetConVarIntMoneyPerKnifeKill ) )

                if( 
GetConVarBoolNotify ) ) {
                    
PrintToChatattacker" \x04[VIP]\x10 Sikeresen kaptál extra\x06 $%d\x10 mert megöltél egy ellenséget!"GetConVarIntMoneyPerKnifeKill ) )
                }
            }

            if( 
GetConVarIntHpKnifeKill ) > &&  GetClientHealthattacker ) < GetConVarIntMaxHP ) ) {
                new 
ClientHealth GetClientHealthattacker )
                
ClientHealth += GetConVarIntHpKnifeKill )

                if( 
ClientHealth GetConVarIntMaxHP ) ) {
                    
ClientHealth GetConVarIntMaxHP 
                }

                
SetEntPropattackerProp_Data"m_iHealth"ClientHealth )

                if( 
GetConVarBoolNotify ) ) {
                    
PrintToChatattacker" \x04[VIP]\x10 Sikeresen kaptál\x06 %d életerőt\x10 mert megöltél egy ellenséget!"GetConVarIntHpKnifeKill ) )
                }                    
            }
        }
        else {
            if( 
GetConVarIntMoneyPerNormalKill ) > && MoneyOffset != -) {
                
SetEntPropattackerProp_Send"m_iAccount"GetEntPropattackerProp_Send"m_iAccount" ) + GetConVarIntMoneyPerNormalKill ) )

                if( 
GetConVarBoolNotify ) ) {
                    
PrintToChatattacker" \x04[VIP]\x10 Sikeresen kaptál extra\x06 $%d\x10 mert megöltél egy ellenséget!"GetConVarIntMoneyPerNormalKill ) )
                }
            }

            if( 
GetConVarIntHpNormalKill ) > && GetClientHealthattacker ) < GetConVarIntMaxHP ) ) {
                new 
ClientHealth GetClientHealthattacker )
                
ClientHealth += GetConVarIntHpNormalKill )

                if( 
ClientHealth GetConVarIntMaxHP ) ) {
                    
ClientHealth GetConVarIntMaxHP 
                }

                
SetEntPropattackerProp_Data"m_iHealth"ClientHealth )

                if( 
GetConVarBoolNotify ) ) {
                    
PrintToChatattacker" \x04[VIP]\x10 Sikeresen kaptál\x06 %d életerőt\x10 mert megöltél egy ellenséget!"GetConVarIntHpNormalKill ) )
                }                    
            }
        }
    }

    return 
Plugin_Continue
}

public 
Event_PhaseEndHandleevent, const Stringname[ ], booldontBroadcast ) { 
    
IsPistolRound true
}

public 
Event_BeginDefuseHandleevent, const Stringname[ ], booldontBroadcast ) {
    if( 
GetConVarBoolPistolRoundRule ) && !IsPistolRound ) {
        new 
client GetClientOfUserIdGetEventIntevent,"userid" ) )

        if( 
client && client MaxClients && IsPlayerAliveclient ) && IsClientVipclient ) && GetConVarBoolHalfDefuseTimeKit ) || GetConVarBoolHalfDefuseTimeNoKit ) ) {
            
CreateTimer0.0DefuseBugFixclient )
        }
    }
}

public 
Event_BeginPlantHandleevent, const Stringname[ ], booldontBroadcast ) {
    if( 
GetConVarBoolPistolRoundRule ) && !IsPistolRound ) {
        new 
client GetClientOfUserIdGetEventIntevent"userid" ) )

        if( 
client && client MaxClients && IsPlayerAliveclient ) && IsClientVipclient ) && GetConVarBoolHalfPlantTime ) ) {
            new 
Bomb GetEntPropEntclientProp_Send"m_hActiveWeapon" )

            
decl StringEntityName20 ]
            
GetEntityClassnameBombEntityNamesizeofEntityName ) )

            if( 
StrEqualEntityName"weapon_c4"false ) ) {
                
SetEntPropFloatBombProp_Send"m_fArmedTime"GetGameTime()+GetConVarFloatHalfPlantTime ) )
            }
        }
    }
}

public 
Event_BombPlantedHandleevent, const Stringname[ ], booldontBroadcast ) {
    if( 
GetConVarBoolPistolRoundRule ) && !IsPistolRound ) {
        if( 
GetConVarBoolShowBombsite ) ) {
            new 
client GetClientOfUserIdGetEventIntevent"userid" ) )

            
decl StringBombsite64 ]
            
GetEntPropStringclientProp_Send"m_szLastPlaceName"BombsitesizeofBombsite ) )

            
decl StringBombsiteBuffer32 ]

            if( 
StrContainsBombsite"BombsiteA" ) != -) {
                
FormatBombsiteBuffersizeofBombsiteBuffer ), "Bombsite A" )
            }
            else if( 
StrContainsBombsite"BombsiteB" ) != -) {
                
FormatBombsiteBuffersizeofBombsiteBuffer ), "Bombsite B" )
            }

            for( new 
1MaxClientsi++ ) {
                if( 
IsClientInGame) && IsClientVip) && GetClientTeam) == && IsPlayerAlive) ) {
                    
PrintToChati" \x04[VIP]\x02 %N\x10 lerakta a bombát ide:\x04 %s"clientBombsiteBuffer )
                }
            }
        }
    }
}

public 
Event_RoundEndHandleevent, const Stringname[ ], booldontBroadcast ) { 
    
RoundID++

    if( 
RoundID == ) {
        
IsPistolRound true
    
}
    else {
        
IsPistolRound false
    
}
}

public 
ActionOnPlayerRunCmdclient, &buttons, &impulseFloatvel], Floatangles], &weapon ) {    
    if( 
IsClientVipclient ) && GetConVarBoolBhop ) && CanBhopclient ] ) {
        if( 
buttons IN_JUMP && IsPlayerAliveclient ) && !( GetEntityFlagsclient ) & FL_ONGROUND ) && !( GetEntityMoveTypeclient ) & MOVETYPE_LADDER ) ) {
            
buttons &= ~IN_JUMP
        
}
    }
}

public 
ActionDefuseBugFixHandletimeranyclient ) {
    if( 
client && client MaxClients && IsClientInGameclient ) && IsPlayerAliveclient ) ) {
        new 
Bomb FindEntityByClassnameMaxClients+1"planted_c4" )

        if( 
Bomb != -) {
            if( 
GetEntPropclientProp_Send"m_bHasDefuser" ) ) {
                
SetEntPropFloatBombProp_Send"m_flDefuseCountDown"GetGameTime( ) + GetConVarFloatHalfDefuseTimeKit ) )

                
SetEntPropFloatclientProp_Send"m_flProgressBarStartTime"GetGameTime( ) ) 
                
SetEntPropclientProp_Send"m_iProgressBarDuration"GetConVarIntHalfDefuseTimeKit ) )
            }
            else {
                
SetEntPropFloatBombProp_Send"m_flDefuseCountDown"GetGameTime( ) + GetConVarFloatHalfDefuseTimeNoKit ) )

                
SetEntPropFloatclientProp_Send"m_flProgressBarStartTime"GetGameTime( ) )  
                
SetEntPropclientProp_Send"m_iProgressBarDuration"GetConVarIntHalfDefuseTimeNoKit ) )
            }
        } 
    }
}

public 
GiveSpawnItemsclient ) {
    if( 
client && client MaxClients && IsClientInGameclient ) && IsPlayerAliveclient ) && GetClientTeamclient ) > ) {
        if( 
GetConVarBoolArmor ) ) {
            
SetEntPropclientProp_Send"m_ArmorValue"100 )
        }

        if( 
GetConVarBoolHelmet ) && GetEntPropclientProp_Send"m_ArmorValue" ) >= ) {
            
SetEntPropclientProp_Send"m_bHasHelmet")
        }

        if( 
GetConVarBoolHE ) && GetEntPropclientProp_Send"m_iAmmo"_14 ) < && GetClientGrenadesclient ) < GetConVarIntFindConVar"ammo_grenade_limit_total") ) ) {
            
GivePlayerItemclient"weapon_hegrenade" )
        }

        if( 
GetConVarBoolFlash ) && GetEntPropclientProp_Send"m_iAmmo"_15 ) < && GetClientGrenadesclient ) < GetConVarIntFindConVar"ammo_grenade_limit_total") ) ) {
            
GivePlayerItemclient"weapon_flashbang" )
        }

        if( 
GetConVarBoolSmoke ) && GetEntPropclientProp_Send"m_iAmmo"_16 ) < && GetClientGrenadesclient ) < GetConVarIntFindConVar"ammo_grenade_limit_total") ) ) {
            
GivePlayerItemclient"weapon_smokegrenade" )
        }

        if( 
GetConVarBoolMolotov ) && GetEntPropclientProp_Send"m_iAmmo"_17 ) < && GetClientGrenadesclient ) < GetConVarIntFindConVar"ammo_grenade_limit_total") ) ) {
            switch( 
GetClientTeamclient ) ) {
                case 
2: {
                    
GivePlayerItemclient"weapon_molotov" )
                }
                case 
3: {
                    
GivePlayerItemclient"weapon_incgrenade" )
                }
            }
        }

        if( 
GetConVarBoolExtraMoneyOnSpawn ) && MoneyOffset != -) {
            
SetEntPropclientProp_Send"m_iAccount"GetEntPropclientProp_Send"m_iAccount" ) + GetConVarIntExtraMoneyOnSpawn ) )
        }

        if( 
GetConVarBoolDefuser ) && GetClientTeamclient ) == && GetEntPropclientProp_Send"m_bHasDefuser" ) < ) {
            
SetEntPropclientProp_Send"m_bHasDefuser")
        }
    }
}

public 
ActionCommand_ToggleBhopclientargs ) {
    if( 
GetConVarBoolPistolRoundRule ) && IsPistolRound ) {
        
PrintToChatclient" \x04[VIP]\x10 Auto-bhop cannot be used in pistol rounds!" )
        return 
Plugin_Handled
    
}
    
    if( 
GetConVarBoolBhop ) && IsClientVipclient ) ) {
        if( 
CanBhopclient ] ) {
            
CanBhopclient ] = false
            SetClientCookie
clientBhopCookie"0" )

            
PrintToChatclient" \x04[VIP]\x10 Auto-bhop was\x02 disabled\x10!" )
        }
        else {
            
CanBhopclient ] = true
            SetClientCookie
clientBhopCookie"1" )

            
PrintToChatclient" \x04[VIP]\x10 Auto-bhop was\x06 enabled\x10!" )
        }
    }
    else {
        
PrintToChatclient" \x04[VIP]\x10 VIP-nek\x06 kell lenned\x10 ,hogy használd ezt a parancsot!" )
    }

    return 
Plugin_Continue
}

public 
ActionCommand_ShowVipsclientargs ) {
    new 
HandleOnlineVips CreateMenuOnlineVips_Handler )
    
SetMenuTitleOnlineVips"Online VIP-játékosok listája" )

    new 
OnlineVipsNum

    
for( new 1MaxClientsi++ ) {
        if( 
IsClientInGame) && IsClientVip) ) {
            
decl StringuNameBuffer32 ]
            
FormatuNameBuffersizeofuNameBuffer ), "%N")

            
AddMenuItemOnlineVips"OnSelect"uNameBufferITEMDRAW_DISABLED )

            
OnlineVipsNum++
        }
    }

    if( 
OnlineVipsNum ) {
        if( 
OnlineVips != INVALID_HANDLE ) {
            
CloseHandleOnlineVips )
        }

        
PrintToChatclient" \x04[VIP]\x10 Jelenleg nincs Online VIP-játékos!" )
    }
    else {
        
SetMenuExitButtonOnlineVipstrue )
        
DisplayMenuOnlineVipsclient30 )
    }
}

public 
OnlineVips_HandlerHandleOnlineVipsMenuActionactionclientmenu ) {
    switch( 
action ) {
        case 
MenuAction_End: {
            if( 
OnlineVips != INVALID_HANDLE ) {
                
CancelMenuOnlineVips )
            }
        }
    }
}

public 
ActionWeaponSwitchPostclientweapon ) {
    if( 
IsClientVipclient ) && IsPlayerAliveclient ) && GetConVarBoolVipSpeed ) ) {
        
SetEntPropFloatclientProp_Send"m_flVelocityModifier"GetConVarFloatSpeedAmmount ) )
    }
}

public 
ActionOnTakeDamagevictim, &attacker, &inflictor, &Float:damage, &damagetype ) { 
    if( 
inflictor && inflictor MaxClients && IsClientInGameinflictor ) && GetClientTeaminflictor ) != GetClientTeamvictim ) ) {
        if( 
IsClientVipinflictor ) && GetConVarBoolDamage ) ) { 
            
damage = ( damage GetConVarIntDamageAmount ) )
            return 
Plugin_Changed
        

    }

    return 
Plugin_Continue
}

stock boolIsClientVipclient ) {
    if( 
GetUserFlagBitsclient ) & VIP_FLAG ) {
        return 
true
    
}

    return 
false
}

stock GetClientGrenadesclient ) {
    new 
Explosive GetEntPropclientProp_Send"m_iAmmo"_14 )
    new 
Flashbang GetEntPropclientProp_Send"m_iAmmo"_15 )
    new 
Smokegrenade GetEntPropclientProp_Send"m_iAmmo"_16 )
    new 
Incendiary GetEntPropclientProp_Send"m_iAmmo"_17 )
    new 
Decoy GetEntPropclientProp_Send"m_iAmmo"_18 )

    return 
Explosive Flashbang Smokegrenade Incendiary Decoy
}

stock RemoveClientGrenadesclient ) {
    if( 
GetEntPropclientProp_Send"m_iAmmo"_14 ) >= ) {
        
SetEntPropclientProp_Send"m_iAmmo"0_14 )
    }

    if( 
GetEntPropclientProp_Send"m_iAmmo"_15 ) >= ) {
        
SetEntPropclientProp_Send"m_iAmmo"0_15 )
    }

    if( 
GetEntPropclientProp_Send"m_iAmmo"_16 ) >= ) {
        
SetEntPropclientProp_Send"m_iAmmo"0_16 )
    }

    if( 
GetEntPropclientProp_Send"m_iAmmo"_17 ) >= ) {
        
SetEntPropclientProp_Send"m_iAmmo"0_17 )
    }

    if( 
GetEntPropclientProp_Send"m_iAmmo"_18 ) >= ) {
        
SetEntPropclientProp_Send"m_iAmmo"0_18 )
    }


Last edited by stevsonn; 01-29-2019 at 15:50.
stevsonn is offline