[CSGO] VIP Pentru Servere Competitive v1.2 (update 23.09.17)

Descărcări de pluginuri și discuții despre acestea.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
tre3fla
Membru eXtream
Membru eXtream
Posts: 5333
Joined: 27 May 2012, 10:15
Detinator Steam: Da
CS Status: Allah Akbar !
Detinator server CS: Nu
SteamID: /id/tre3fla_xxx
Has thanked: 14 times
Been thanked: 129 times

19 Sep 2017, 13:13

Descarcare Surse (.sp)
csgo_vip 1.0 | Afiseaza codul
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <clientprefs>

#define VIP_FLAG ADMFLAG_CUSTOM1

Handle: Armor
Handle: Helmet
Handle: Bhop
Handle: Defuser
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 Handle: BhopCookie = INVALID_HANDLE

new MoneyOffset = -1
new RoundID = 0

bool: CanBhop[ MAXPLAYERS + 1 ]
bool: IsPistolRound = false

public Plugin:myinfo = {
	name = "CS:GO VIP",
	author = "tre3fla",
	description = "VIP pentru serverele de csgo",
	version = "1.0",
	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", "1", "VIP poate face bhop automat cand tine apasat space" )
	Defuser = CreateConVar( "vip_give_ct_defuser", "1", "VIP primeste defuser atunci cand este CT" )
	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", "1", "VIP nu va rula un in rundele de pistoale pe competitive" )
	ExtraMoneyOnSpawn = CreateConVar( "vip_give_money_on_spawn", "500", "VIP va primi aceea suma de bani la spawn. 0=dezactivat" ) 
	HpNormalKill = CreateConVar( "vip_normal_kill_hp", "10", "VIP va primi HP cand face frag" )
	HpKnifeKill = CreateConVar( "vip_knife_kill_hp", "30", "VIP va primi HP cand face frag cu cutitul" )
	HpHeadShotKill = CreateConVar( "vip_headshot_hp", "15", "VIP va primit HP cand face frag cu headshot" )
	MaxHP = CreateConVar( "vip_max_hp", "100", "HP-ul maxim pe care il poate avea un VIP" )
	MoneyPerNormalKill = CreateConVar( "vip_normal_kill_money", "100", "VIP va primi acea suma de bani cand face frag" )
	MoneyPerKnifeKill = CreateConVar( "vip_knife_kill_money", "1000", "VIP va primi acea suma de bani cand face frag cu cutitul" )
	MoneyPerHeadShotKill = CreateConVar( "vip_headshot_kill_money", "150", "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 )

	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_RoundEnd, EventHookMode_PostNoCopy )
}

public OnMapStart( ) {
	RoundID = 0
	IsPistolRound = false
}

public OnClientCookiesCached( client ) {
	decl String: UserCookie[ 5 ]
	GetClientCookie( client, BhopCookie, UserCookie, sizeof( UserCookie ) )

	if( StrEqual( UserCookie, "1" ) && IsClientVip( client ) ) {
		CanBhop[ client ] = true
	}
	else {
		CanBhop[ client ] = false
		SetClientCookie( client, BhopCookie, "0" )
	}
}

public Action: Event_PlayerSpawn( Handle: event, const String: name[ ], bool: dontBroadcast ) { 
	if( GetConVarBool( PistolRoundRule ) && IsPistolRound ) {
		return Plugin_Handled
	} 

	new client = GetClientOfUserId( GetEventInt( event, "userid" ) )

	if( client > 0 && client < MaxClients && IsClientInGame( client ) && IsPlayerAlive( client ) && !IsFakeClient( client ) ) {
		if( IsClientVip( client ) ) {
			RemoveClientGrenades( client )
			RequestFrame( GiveSpawnItems, client )
		}
	}
	return Plugin_Continue
}

public Action: Event_PlayerDeath( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && IsPistolRound ) {
		return Plugin_Handled
	} 

	new victim = GetClientOfUserId( GetEventInt( event, "userid" ) )
	new attacker = GetClientOfUserId( GetEventInt( event, "attacker" ) )

	if( attacker > 0 && attacker < MaxClients && IsClientInGame( attacker ) && victim > 0 && victim < MaxClients && IsClientInGame( victim ) && IsClientVip( attacker ) && attacker != victim ) {
		new bool:Headshot = GetEventBool( event, "headshot" )

		char Arma[ 64 ]
		GetEventString( event, "weapon", Arma, sizeof( Arma ) )

		if( Headshot ) {
			if( GetConVarInt( MoneyPerHeadShotKill ) > 0 && MoneyOffset != -1 ) {
				SetEntProp( attacker, Prop_Send, "m_iAccount", GetEntProp( attacker, Prop_Send, "m_iAccount" ) + GetConVarInt( MoneyPerHeadShotKill ) )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved extra\x06 $%d\x10 for killing an enemy!", GetConVarInt( MoneyPerHeadShotKill ) )
				}
			}

			if( GetConVarInt( HpHeadShotKill ) > 0 && GetClientHealth( attacker ) < GetConVarInt( MaxHP ) ) {
				new ClientHealth = GetClientHealth( attacker )
				ClientHealth += GetConVarInt( HpHeadShotKill )

				if( ClientHealth > GetConVarInt( MaxHP ) ) {
					ClientHealth = GetConVarInt( MaxHP ) 
				}

				SetEntProp( attacker, Prop_Data, "m_iHealth", ClientHealth )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved\x06 %d HP\x10 for killing an enemy!", GetConVarInt( HpHeadShotKill ) )
				}					
			}
		}
		else if( ( StrContains( Arma, "knife", false ) != -1 ) || ( StrContains( Arma, "bayonet", false ) != -1 ) ) {
			if( GetConVarInt( MoneyPerKnifeKill ) > 0 && MoneyOffset != -1 ) {
				SetEntProp( attacker, Prop_Send, "m_iAccount", GetEntProp( attacker, Prop_Send, "m_iAccount" ) + GetConVarInt( MoneyPerKnifeKill ) )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved extra\x06 $%d\x10 for killing an enemy!", GetConVarInt( MoneyPerKnifeKill ) )
				}
			}

			if( GetConVarInt( HpKnifeKill ) > 0 &&  GetClientHealth( attacker ) < GetConVarInt( MaxHP ) ) {
				new ClientHealth = GetClientHealth( attacker )
				ClientHealth += GetConVarInt( HpKnifeKill )

				if( ClientHealth > GetConVarInt( MaxHP ) ) {
					ClientHealth = GetConVarInt( MaxHP ) 
				}

				SetEntProp( attacker, Prop_Data, "m_iHealth", ClientHealth )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved\x06 %d HP\x10 for killing an enemy!", GetConVarInt( HpKnifeKill ) )
				}					
			}
		}
		else {
			if( GetConVarInt( MoneyPerNormalKill ) > 0 && MoneyOffset != -1 ) {
				SetEntProp( attacker, Prop_Send, "m_iAccount", GetEntProp( attacker, Prop_Send, "m_iAccount" ) + GetConVarInt( MoneyPerNormalKill ) )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved extra\x06 $%d\x10 for killing an enemy!", GetConVarInt( MoneyPerNormalKill ) )
				}
			}

			if( GetConVarInt( HpNormalKill ) > 0 && GetClientHealth( attacker ) < GetConVarInt( MaxHP ) ) {
				new ClientHealth = GetClientHealth( attacker )
				ClientHealth += GetConVarInt( HpNormalKill )

				if( ClientHealth > GetConVarInt( MaxHP ) ) {
					ClientHealth = GetConVarInt( MaxHP ) 
				}

				SetEntProp( attacker, Prop_Data, "m_iHealth", ClientHealth )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved\x06 %d HP\x10 for killing an enemy!", GetConVarInt( HpNormalKill ) )
				}					
			}
		}
	}

	return Plugin_Continue
}

public Event_PhaseEnd( Handle: event, const String: name[ ], bool: dontBroadcast ) { 
	IsPistolRound = true
}

public Event_BeginDefuse( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && !IsPistolRound ) {
		new client = GetClientOfUserId( GetEventInt( event,"userid" ) )

		if( client > 0 && client < MaxClients && IsPlayerAlive( client ) && IsClientVip( client ) && GetConVarBool( HalfDefuseTimeKit ) || GetConVarBool( HalfDefuseTimeNoKit ) ) {
			CreateTimer( 0.0, DefuseBugFix, client )
		}
	}
}

public Event_BeginPlant( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && !IsPistolRound ) {
		new client = GetClientOfUserId( GetEventInt( event, "userid" ) )

		if( client > 0 && client < MaxClients && IsPlayerAlive( client ) && IsClientVip( client ) && GetConVarBool( HalfPlantTime ) ) {
			new Bomb = GetEntPropEnt( client, Prop_Send, "m_hActiveWeapon" )

			decl String: EntityName[ 20 ]
			GetEntityClassname( Bomb, EntityName, sizeof( EntityName ) )

			if( StrEqual( EntityName, "weapon_c4", false ) ) {
				SetEntPropFloat( Bomb, Prop_Send, "m_fArmedTime", GetGameTime()+GetConVarFloat( HalfPlantTime ) )
			}
		}
	}
}

public Event_BombPlanted( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && !IsPistolRound ) {
		if( GetConVarBool( ShowBombsite ) ) {
			new client = GetClientOfUserId( GetEventInt( event, "userid" ) )

			decl String: Bombsite[ 64 ]
			GetEntPropString( client, Prop_Send, "m_szLastPlaceName", Bombsite, sizeof( Bombsite ) )

			decl String: BombsiteBuffer[ 32 ]

			if( StrContains( Bombsite, "BombsiteA" ) != -1 ) {
				Format( BombsiteBuffer, sizeof( BombsiteBuffer ), "Bombsite A" )
			}
			else if( StrContains( Bombsite, "BombsiteB" ) != -1 ) {
				Format( BombsiteBuffer, sizeof( BombsiteBuffer ), "Bombsite B" )
			}

			for( new i = 1; i < MaxClients; i++ ) {
				if( IsClientInGame( i ) && IsClientVip( i ) && GetClientTeam( i ) == 3 && IsPlayerAlive( i ) ) {
					PrintToChat( i, " \x04[VIP]\x02 %N\x10 has planted the bomb in\x04 %s", client, BombsiteBuffer )
				}
			}
		}
	}
}

public Event_RoundEnd( Handle: event, const String: name[ ], bool: dontBroadcast ) { 
	RoundID++

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

public Action: OnPlayerRunCmd( client, &buttons, &impulse, Float: vel[ 3 ], Float: angles[ 3 ], &weapon ) {	
	if( IsClientVip( client ) && GetConVarBool( Bhop ) && CanBhop[ client ] ) {
		if( buttons & IN_JUMP && IsPlayerAlive( client ) && !( GetEntityFlags( client ) & FL_ONGROUND ) && !( GetEntityMoveType( client ) & MOVETYPE_LADDER ) ) {
			buttons &= ~IN_JUMP
		}
	}
}

public Action: DefuseBugFix( Handle: timer, any: client ) {
	if( client > 0 && client < MaxClients && IsClientInGame( client ) && IsPlayerAlive( client ) ) {
		new Bomb = FindEntityByClassname( MaxClients+1, "planted_c4" )

		if( Bomb != -1 ) {
			if( GetEntProp( client, Prop_Send, "m_bHasDefuser" ) ) {
				SetEntPropFloat( Bomb, Prop_Send, "m_flDefuseCountDown", GetGameTime( ) + GetConVarFloat( HalfDefuseTimeKit ) )

				SetEntPropFloat( client, Prop_Send, "m_flProgressBarStartTime", GetGameTime( ) ) 
				SetEntProp( client, Prop_Send, "m_iProgressBarDuration", GetConVarInt( HalfDefuseTimeKit ) )
			}
			else {
				SetEntPropFloat( Bomb, Prop_Send, "m_flDefuseCountDown", GetGameTime( ) + GetConVarFloat( HalfDefuseTimeNoKit ) )

				SetEntPropFloat( client, Prop_Send, "m_flProgressBarStartTime", GetGameTime( ) )  
				SetEntProp( client, Prop_Send, "m_iProgressBarDuration", GetConVarInt( HalfDefuseTimeNoKit ) )
			}
		} 
	}
}

public GiveSpawnItems( client ) {
	if( client > 0 && client < MaxClients && IsClientInGame( client ) && IsPlayerAlive( client ) && GetClientTeam( client ) > 1 ) {
		if( GetConVarBool( Armor ) ) {
			SetEntProp( client, Prop_Send, "m_ArmorValue", 100 )
		}

		if( GetConVarBool( Helmet ) && GetEntProp( client, Prop_Send, "m_ArmorValue" ) >= 1 ) {
			SetEntProp( client, Prop_Send, "m_bHasHelmet", 1 )
		}

		if( GetConVarBool( HE ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 14 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			GivePlayerItem( client, "weapon_hegrenade" )
		}

		if( GetConVarBool( Flash ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 15 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			GivePlayerItem( client, "weapon_flashbang" )
		}

		if( GetConVarBool( Smoke ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 16 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			GivePlayerItem( client, "weapon_smokegrenade" )
		}

		if( GetConVarBool( Molotov ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 17 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			switch( GetClientTeam( client ) ) {
				case 2: {
					GivePlayerItem( client, "weapon_molotov" )
				}
				case 3: {
					GivePlayerItem( client, "weapon_incgrenade" )
				}
			}
		}

		if( GetConVarBool( ExtraMoneyOnSpawn ) && MoneyOffset != -1 ) {
			SetEntProp( client, Prop_Send, "m_iAccount", GetEntProp( client, Prop_Send, "m_iAccount" ) + GetConVarInt( ExtraMoneyOnSpawn ) )
		}

		if( GetConVarBool( Defuser ) && GetClientTeam( client ) == 3 && GetEntProp( client, Prop_Send, "m_bHasDefuser" ) < 1 ) {
			SetEntProp( client, Prop_Send, "m_bHasDefuser", 1 )
		}
	}
}

public Action: Command_ToggleBhop( client, args ) {
	if( GetConVarBool( PistolRoundRule ) && IsPistolRound ) {
		PrintToChat( client, " \x04[VIP]\x10 Auto-bhop cannot be used in pistol rounds!" )
		return Plugin_Handled
	}
	
	if( GetConVarBool( Bhop ) && IsClientVip( client ) ) {
		if( CanBhop[ client ] ) {
			CanBhop[ client ] = false
			SetClientCookie( client, BhopCookie, "0" )

			PrintToChat( client, " \x04[VIP]\x10 Auto-bhop was\x02 disabled\x10!" )
		}
		else {
			CanBhop[ client ] = true
			SetClientCookie( client, BhopCookie, "1" )

			PrintToChat( client, " \x04[VIP]\x10 Auto-bhop was\x06 enabled\x10!" )
		}
	}
	else {
		PrintToChat( client, " \x04[VIP]\x10 You need to be\x06 VIP\x10 to use this command!" )
	}

	return Plugin_Continue
}

stock bool: IsClientVip( client ) {
	if( GetUserFlagBits( client ) & VIP_FLAG ) {
		return true
	}

	return false
}

stock GetClientGrenades( client ) {
	new Explosive = GetEntProp( client, Prop_Send, "m_iAmmo", _, 14 )
	new Flashbang = GetEntProp( client, Prop_Send, "m_iAmmo", _, 15 )
	new Smokegrenade = GetEntProp( client, Prop_Send, "m_iAmmo", _, 16 )
	new Incendiary = GetEntProp( client, Prop_Send, "m_iAmmo", _, 17 )
	new Decoy = GetEntProp( client, Prop_Send, "m_iAmmo", _, 18 )

	return Explosive + Flashbang + Smokegrenade + Incendiary + Decoy
}

stock RemoveClientGrenades( client ) {
	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 14 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 14 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 15 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 15 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 16 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 16 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 17 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 17 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 18 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 18 )
	}
}
csgo_vip 1.1 | Afiseaza codul
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <clientprefs>

#define VIP_FLAG ADMFLAG_CUSTOM1

Handle: Armor
Handle: Helmet
Handle: Bhop
Handle: Defuser
Handle: VipSpeed
Handle: SpeedAmmount
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 Handle: BhopCookie = INVALID_HANDLE

new RoundID = 0

bool: CanBhop[ MAXPLAYERS + 1 ]
bool: IsPistolRound = false

public Plugin:myinfo = {
	name = "CS:GO VIP",
	author = "tre3fla",
	description = "VIP pentru serverele de csgo",
	version = "1.1",
	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", "1", "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", "1", "VIP primeste viteza de miscare mai mare" )
	SpeedAmmount = CreateConVar( "vip_speed_ammount", "1.2", "Cat de rapid sa se miste VIP" )
	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", "1", "VIP nu va rula un in rundele de pistoale pe competitive" )
	ExtraMoneyOnSpawn = CreateConVar( "vip_give_money_on_spawn", "500", "VIP va primi aceea suma de bani la spawn. 0=dezactivat" ) 
	HpNormalKill = CreateConVar( "vip_normal_kill_hp", "10", "VIP va primi HP cand face frag" )
	HpKnifeKill = CreateConVar( "vip_knife_kill_hp", "30", "VIP va primi HP cand face frag cu cutitul" )
	HpHeadShotKill = CreateConVar( "vip_headshot_hp", "15", "VIP va primit HP cand face frag cu headshot" )
	MaxHP = CreateConVar( "vip_max_hp", "100", "HP-ul maxim pe care il poate avea un VIP" )
	MoneyPerNormalKill = CreateConVar( "vip_normal_kill_money", "100", "VIP va primi acea suma de bani cand face frag" )
	MoneyPerKnifeKill = CreateConVar( "vip_knife_kill_money", "1000", "VIP va primi acea suma de bani cand face frag cu cutitul" )
	MoneyPerHeadShotKill = CreateConVar( "vip_headshot_kill_money", "150", "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" )

	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_RoundEnd, EventHookMode_PostNoCopy )
}

public OnMapStart( ) {
	RoundID = 0
	IsPistolRound = false
}

public OnClientCookiesCached( client ) {
	decl String: UserCookie[ 5 ]
	GetClientCookie( client, BhopCookie, UserCookie, sizeof( UserCookie ) )

	if( StrEqual( UserCookie, "1" ) && IsClientVip( client ) ) {
		CanBhop[ client ] = true
	}
	else {
		CanBhop[ client ] = false
		SetClientCookie( client, BhopCookie, "0" )
	}
}

public OnClientPutInServer( client ) {
	SDKHook( client, SDKHook_WeaponSwitchPost, WeaponSwitchPost )
}

public Action: Event_PlayerSpawn( Handle: event, const String: name[ ], bool: dontBroadcast ) { 
	if( GetConVarBool( PistolRoundRule ) && IsPistolRound ) {
		return Plugin_Handled
	} 

	new client = GetClientOfUserId( GetEventInt( event, "userid" ) )

	if( client > 0 && client < MaxClients && IsClientInGame( client ) && IsPlayerAlive( client ) && !IsFakeClient( client ) ) {
		if( IsClientVip( client ) ) {
			RemoveClientGrenades( client )
			RequestFrame( GiveSpawnItems, client )
		}
	}
	return Plugin_Continue
}

public Action: Event_PlayerDeath( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && IsPistolRound ) {
		return Plugin_Handled
	} 

	new victim = GetClientOfUserId( GetEventInt( event, "userid" ) )
	new attacker = GetClientOfUserId( GetEventInt( event, "attacker" ) )

	if( attacker > 0 && attacker < MaxClients && IsClientInGame( attacker ) && victim > 0 && victim < MaxClients && IsClientInGame( victim ) && IsClientVip( attacker ) && attacker != victim ) {
		new bool:Headshot = GetEventBool( event, "headshot" )

		char Arma[ 64 ]
		GetEventString( event, "weapon", Arma, sizeof( Arma ) )

		if( Headshot ) {
			if( GetConVarInt( MoneyPerHeadShotKill ) > 0 ) {
				SetEntProp( attacker, Prop_Send, "m_iAccount", GetEntProp( attacker, Prop_Send, "m_iAccount" ) + GetConVarInt( MoneyPerHeadShotKill ) )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved extra\x06 $%d\x10 for killing an enemy!", GetConVarInt( MoneyPerHeadShotKill ) )
				}
			}

			if( GetConVarInt( HpHeadShotKill ) > 0 && GetClientHealth( attacker ) < GetConVarInt( MaxHP ) ) {
				new ClientHealth = GetClientHealth( attacker )
				ClientHealth += GetConVarInt( HpHeadShotKill )

				if( ClientHealth > GetConVarInt( MaxHP ) ) {
					ClientHealth = GetConVarInt( MaxHP ) 
				}

				SetEntProp( attacker, Prop_Data, "m_iHealth", ClientHealth )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved\x06 %d HP\x10 for killing an enemy!", GetConVarInt( HpHeadShotKill ) )
				}					
			}
		}
		else if( ( StrContains( Arma, "knife", false ) != -1 ) || ( StrContains( Arma, "bayonet", false ) != -1 ) ) {
			if( GetConVarInt( MoneyPerKnifeKill ) > 0 ) {
				SetEntProp( attacker, Prop_Send, "m_iAccount", GetEntProp( attacker, Prop_Send, "m_iAccount" ) + GetConVarInt( MoneyPerKnifeKill ) )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved extra\x06 $%d\x10 for killing an enemy!", GetConVarInt( MoneyPerKnifeKill ) )
				}
			}

			if( GetConVarInt( HpKnifeKill ) > 0 &&  GetClientHealth( attacker ) < GetConVarInt( MaxHP ) ) {
				new ClientHealth = GetClientHealth( attacker )
				ClientHealth += GetConVarInt( HpKnifeKill )

				if( ClientHealth > GetConVarInt( MaxHP ) ) {
					ClientHealth = GetConVarInt( MaxHP ) 
				}

				SetEntProp( attacker, Prop_Data, "m_iHealth", ClientHealth )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved\x06 %d HP\x10 for killing an enemy!", GetConVarInt( HpKnifeKill ) )
				}					
			}
		}
		else {
			if( GetConVarInt( MoneyPerNormalKill ) > 0 ) {
				SetEntProp( attacker, Prop_Send, "m_iAccount", GetEntProp( attacker, Prop_Send, "m_iAccount" ) + GetConVarInt( MoneyPerNormalKill ) )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved extra\x06 $%d\x10 for killing an enemy!", GetConVarInt( MoneyPerNormalKill ) )
				}
			}

			if( GetConVarInt( HpNormalKill ) > 0 && GetClientHealth( attacker ) < GetConVarInt( MaxHP ) ) {
				new ClientHealth = GetClientHealth( attacker )
				ClientHealth += GetConVarInt( HpNormalKill )

				if( ClientHealth > GetConVarInt( MaxHP ) ) {
					ClientHealth = GetConVarInt( MaxHP ) 
				}

				SetEntProp( attacker, Prop_Data, "m_iHealth", ClientHealth )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved\x06 %d HP\x10 for killing an enemy!", GetConVarInt( HpNormalKill ) )
				}					
			}
		}
	}

	return Plugin_Continue
}

public Event_PhaseEnd( Handle: event, const String: name[ ], bool: dontBroadcast ) { 
	IsPistolRound = true
}

public Event_BeginDefuse( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && !IsPistolRound ) {
		new client = GetClientOfUserId( GetEventInt( event,"userid" ) )

		if( client > 0 && client < MaxClients && IsPlayerAlive( client ) && IsClientVip( client ) && GetConVarBool( HalfDefuseTimeKit ) || GetConVarBool( HalfDefuseTimeNoKit ) ) {
			CreateTimer( 0.0, DefuseBugFix, client )
		}
	}
}

public Event_BeginPlant( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && !IsPistolRound ) {
		new client = GetClientOfUserId( GetEventInt( event, "userid" ) )

		if( client > 0 && client < MaxClients && IsPlayerAlive( client ) && IsClientVip( client ) && GetConVarBool( HalfPlantTime ) ) {
			new Bomb = GetEntPropEnt( client, Prop_Send, "m_hActiveWeapon" )

			decl String: EntityName[ 20 ]
			GetEntityClassname( Bomb, EntityName, sizeof( EntityName ) )

			if( StrEqual( EntityName, "weapon_c4", false ) ) {
				SetEntPropFloat( Bomb, Prop_Send, "m_fArmedTime", GetGameTime()+GetConVarFloat( HalfPlantTime ) )
			}
		}
	}
}

public Event_BombPlanted( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && !IsPistolRound ) {
		if( GetConVarBool( ShowBombsite ) ) {
			new client = GetClientOfUserId( GetEventInt( event, "userid" ) )

			decl String: Bombsite[ 64 ]
			GetEntPropString( client, Prop_Send, "m_szLastPlaceName", Bombsite, sizeof( Bombsite ) )

			decl String: BombsiteBuffer[ 32 ]

			if( StrContains( Bombsite, "BombsiteA" ) != -1 ) {
				Format( BombsiteBuffer, sizeof( BombsiteBuffer ), "Bombsite A" )
			}
			else if( StrContains( Bombsite, "BombsiteB" ) != -1 ) {
				Format( BombsiteBuffer, sizeof( BombsiteBuffer ), "Bombsite B" )
			}

			for( new i = 1; i < MaxClients; i++ ) {
				if( IsClientInGame( i ) && IsClientVip( i ) && GetClientTeam( i ) == 3 && IsPlayerAlive( i ) ) {
					PrintToChat( i, " \x04[VIP]\x02 %N\x10 has planted the bomb in\x04 %s", client, BombsiteBuffer )
				}
			}
		}
	}
}

public Event_RoundEnd( Handle: event, const String: name[ ], bool: dontBroadcast ) { 
	RoundID++

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

public Action: OnPlayerRunCmd( client, &buttons, &impulse, Float: vel[ 3 ], Float: angles[ 3 ], &weapon ) {	
	if( IsClientVip( client ) && GetConVarBool( Bhop ) && CanBhop[ client ] ) {
		if( buttons & IN_JUMP && IsPlayerAlive( client ) && !( GetEntityFlags( client ) & FL_ONGROUND ) && !( GetEntityMoveType( client ) & MOVETYPE_LADDER ) ) {
			buttons &= ~IN_JUMP
		}
	}
}

public Action: DefuseBugFix( Handle: timer, any: client ) {
	if( client > 0 && client < MaxClients && IsClientInGame( client ) && IsPlayerAlive( client ) ) {
		new Bomb = FindEntityByClassname( MaxClients+1, "planted_c4" )

		if( Bomb != -1 ) {
			if( GetEntProp( client, Prop_Send, "m_bHasDefuser" ) ) {
				SetEntPropFloat( Bomb, Prop_Send, "m_flDefuseCountDown", GetGameTime( ) + GetConVarFloat( HalfDefuseTimeKit ) )

				SetEntPropFloat( client, Prop_Send, "m_flProgressBarStartTime", GetGameTime( ) ) 
				SetEntProp( client, Prop_Send, "m_iProgressBarDuration", GetConVarInt( HalfDefuseTimeKit ) )
			}
			else {
				SetEntPropFloat( Bomb, Prop_Send, "m_flDefuseCountDown", GetGameTime( ) + GetConVarFloat( HalfDefuseTimeNoKit ) )

				SetEntPropFloat( client, Prop_Send, "m_flProgressBarStartTime", GetGameTime( ) )  
				SetEntProp( client, Prop_Send, "m_iProgressBarDuration", GetConVarInt( HalfDefuseTimeNoKit ) )
			}
		} 
	}
}

public GiveSpawnItems( client ) {
	if( client > 0 && client < MaxClients && IsClientInGame( client ) && IsPlayerAlive( client ) && GetClientTeam( client ) > 1 ) {
		if( GetConVarBool( Armor ) ) {
			SetEntProp( client, Prop_Send, "m_ArmorValue", 100 )
		}

		if( GetConVarBool( Helmet ) && GetEntProp( client, Prop_Send, "m_ArmorValue" ) >= 1 ) {
			SetEntProp( client, Prop_Send, "m_bHasHelmet", 1 )
		}

		if( GetConVarBool( HE ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 14 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			GivePlayerItem( client, "weapon_hegrenade" )
		}

		if( GetConVarBool( Flash ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 15 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			GivePlayerItem( client, "weapon_flashbang" )
		}

		if( GetConVarBool( Smoke ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 16 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			GivePlayerItem( client, "weapon_smokegrenade" )
		}

		if( GetConVarBool( Molotov ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 17 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			switch( GetClientTeam( client ) ) {
				case 2: {
					GivePlayerItem( client, "weapon_molotov" )
				}
				case 3: {
					GivePlayerItem( client, "weapon_incgrenade" )
				}
			}
		}

		if( GetConVarBool( ExtraMoneyOnSpawn ) ) {
			SetEntProp( client, Prop_Send, "m_iAccount", GetEntProp( client, Prop_Send, "m_iAccount" ) + GetConVarInt( ExtraMoneyOnSpawn ) )
		}

		if( GetConVarBool( Defuser ) && GetClientTeam( client ) == 3 && GetEntProp( client, Prop_Send, "m_bHasDefuser" ) < 1 ) {
			SetEntProp( client, Prop_Send, "m_bHasDefuser", 1 )
		}
	}
}

public Action: Command_ToggleBhop( client, args ) {
	if( GetConVarBool( PistolRoundRule ) && IsPistolRound ) {
		PrintToChat( client, " \x04[VIP]\x10 Auto-bhop cannot be used in pistol rounds!" )
		return Plugin_Handled
	}
	
	if( GetConVarBool( Bhop ) && IsClientVip( client ) ) {
		if( CanBhop[ client ] ) {
			CanBhop[ client ] = false
			SetClientCookie( client, BhopCookie, "0" )

			PrintToChat( client, " \x04[VIP]\x10 Auto-bhop was\x02 disabled\x10!" )
		}
		else {
			CanBhop[ client ] = true
			SetClientCookie( client, BhopCookie, "1" )

			PrintToChat( client, " \x04[VIP]\x10 Auto-bhop was\x06 enabled\x10!" )
		}
	}
	else {
		PrintToChat( client, " \x04[VIP]\x10 You need to be\x06 VIP\x10 to use this command!" )
	}

	return Plugin_Continue
}

public Action: Command_ShowVips( client, args ) {
	new Handle: OnlineVips = CreateMenu( OnlineVips_Handler )
	SetMenuTitle( OnlineVips, "Online VIPS List" )

	new OnlineVipsNum

	for( new i = 1; i < MaxClients; i++ ) {
		if( IsClientInGame( i ) && IsClientVip( i ) ) {
			decl String: uNameBuffer[ 32 ]
			Format( uNameBuffer, sizeof( uNameBuffer ), "%N", i )

			AddMenuItem( OnlineVips, "OnSelect", uNameBuffer, ITEMDRAW_DISABLED )

			OnlineVipsNum++
		}
	}

	if( OnlineVipsNum < 1 ) {
		if( OnlineVips != INVALID_HANDLE ) {
			CloseHandle( OnlineVips )
		}

		PrintToChat( client, " \x04[VIP]\x10 There are no vips online!" )
	}
	else {
		SetMenuExitButton( OnlineVips, true )
		DisplayMenu( OnlineVips, client, 30 )
	}
}

public Action: WeaponSwitchPost( client, weapon ) {
	if( IsClientVip( client ) && IsPlayerAlive( client ) && GetConVarBool( VipSpeed ) ) {
		SetEntPropFloat( client, Prop_Send, "m_flVelocityModifier", GetConVarFloat( SpeedAmmount ) )
	}
}

public OnlineVips_Handler( Handle: OnlineVips, MenuAction: action, client, menu ) {
	switch( action ) {
		case MenuAction_End: {
			if( OnlineVips != INVALID_HANDLE ) {
				CancelMenu( OnlineVips )
			}
		}
	}
}

stock bool: IsClientVip( client ) {
	if( GetUserFlagBits( client ) & VIP_FLAG ) {
		return true
	}

	return false
}

stock GetClientGrenades( client ) {
	new Explosive = GetEntProp( client, Prop_Send, "m_iAmmo", _, 14 )
	new Flashbang = GetEntProp( client, Prop_Send, "m_iAmmo", _, 15 )
	new Smokegrenade = GetEntProp( client, Prop_Send, "m_iAmmo", _, 16 )
	new Incendiary = GetEntProp( client, Prop_Send, "m_iAmmo", _, 17 )
	new Decoy = GetEntProp( client, Prop_Send, "m_iAmmo", _, 18 )

	return Explosive + Flashbang + Smokegrenade + Incendiary + Decoy
}

stock RemoveClientGrenades( client ) {
	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 14 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 14 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 15 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 15 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 16 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 16 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 17 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 17 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 18 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 18 )
	}
}
csgo_vip 1.2 | Afiseaza codul
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <clientprefs>

#define VIP_FLAG ADMFLAG_CUSTOM1

Handle: Armor
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 Handle: BhopCookie = INVALID_HANDLE

new MoneyOffset = -1
new RoundID = 0

bool: CanBhop[ MAXPLAYERS + 1 ]
bool: IsPistolRound = 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", "1", "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", "1", "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", "1", "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", "1", "VIP nu va rula un in rundele de pistoale pe competitive" )
	ExtraMoneyOnSpawn = CreateConVar( "vip_give_money_on_spawn", "500", "VIP va primi aceea suma de bani la spawn. 0=dezactivat" ) 
	HpNormalKill = CreateConVar( "vip_normal_kill_hp", "10", "VIP va primi HP cand face frag" )
	HpKnifeKill = CreateConVar( "vip_knife_kill_hp", "30", "VIP va primi HP cand face frag cu cutitul" )
	HpHeadShotKill = CreateConVar( "vip_headshot_hp", "15", "VIP va primit HP cand face frag cu headshot" )
	MaxHP = CreateConVar( "vip_max_hp", "100", "HP-ul maxim pe care il poate avea un VIP" )
	MoneyPerNormalKill = CreateConVar( "vip_normal_kill_money", "100", "VIP va primi acea suma de bani cand face frag" )
	MoneyPerKnifeKill = CreateConVar( "vip_knife_kill_money", "1000", "VIP va primi acea suma de bani cand face frag cu cutitul" )
	MoneyPerHeadShotKill = CreateConVar( "vip_headshot_kill_money", "150", "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_RoundEnd, EventHookMode_PostNoCopy )
}

public OnMapStart( ) {
	RoundID = 0
	IsPistolRound = false
}

public OnClientCookiesCached( client ) {
	decl String: UserCookie[ 5 ]
	GetClientCookie( client, BhopCookie, UserCookie, sizeof( UserCookie ) )

	if( StrEqual( UserCookie, "1" ) && IsClientVip( client ) ) {
		CanBhop[ client ] = true
	}
	else {
		CanBhop[ client ] = false
		SetClientCookie( client, BhopCookie, "0" )
	}
}

public OnClientPutInServer( client ) {
	SDKHook( client, SDKHook_WeaponSwitchPost, WeaponSwitchPost )
	SDKHook( client, SDKHook_OnTakeDamage, OnTakeDamage )
}

public Action: Event_PlayerSpawn( Handle: event, const String: name[ ], bool: dontBroadcast ) { 
	if( GetConVarBool( PistolRoundRule ) && IsPistolRound ) {
		return Plugin_Handled
	} 

	new client = GetClientOfUserId( GetEventInt( event, "userid" ) )

	if( client > 0 && client < MaxClients && IsClientInGame( client ) && IsPlayerAlive( client ) && !IsFakeClient( client ) ) {
		if( IsClientVip( client ) ) {
			RemoveClientGrenades( client )
			RequestFrame( GiveSpawnItems, client )
		}
	}
	return Plugin_Continue
}

public Action: Event_PlayerDeath( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && IsPistolRound ) {
		return Plugin_Handled
	} 

	new victim = GetClientOfUserId( GetEventInt( event, "userid" ) )
	new attacker = GetClientOfUserId( GetEventInt( event, "attacker" ) )

	if( attacker > 0 && attacker < MaxClients && IsClientInGame( attacker ) && victim > 0 && victim < MaxClients && IsClientInGame( victim ) && IsClientVip( attacker ) && attacker != victim ) {
		new bool:Headshot = GetEventBool( event, "headshot" )

		char Arma[ 64 ]
		GetEventString( event, "weapon", Arma, sizeof( Arma ) )

		if( Headshot ) {
			if( GetConVarInt( MoneyPerHeadShotKill ) > 0 && MoneyOffset != -1 ) {
				SetEntProp( attacker, Prop_Send, "m_iAccount", GetEntProp( attacker, Prop_Send, "m_iAccount" ) + GetConVarInt( MoneyPerHeadShotKill ) )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved extra\x06 $%d\x10 for killing an enemy!", GetConVarInt( MoneyPerHeadShotKill ) )
				}
			}

			if( GetConVarInt( HpHeadShotKill ) > 0 && GetClientHealth( attacker ) < GetConVarInt( MaxHP ) ) {
				new ClientHealth = GetClientHealth( attacker )
				ClientHealth += GetConVarInt( HpHeadShotKill )

				if( ClientHealth > GetConVarInt( MaxHP ) ) {
					ClientHealth = GetConVarInt( MaxHP ) 
				}

				SetEntProp( attacker, Prop_Data, "m_iHealth", ClientHealth )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved\x06 %d HP\x10 for killing an enemy!", GetConVarInt( HpHeadShotKill ) )
				}					
			}
		}
		else if( ( StrContains( Arma, "knife", false ) != -1 ) || ( StrContains( Arma, "bayonet", false ) != -1 ) ) {
			if( GetConVarInt( MoneyPerKnifeKill ) > 0 && MoneyOffset != -1 ) {
				SetEntProp( attacker, Prop_Send, "m_iAccount", GetEntProp( attacker, Prop_Send, "m_iAccount" ) + GetConVarInt( MoneyPerKnifeKill ) )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved extra\x06 $%d\x10 for killing an enemy!", GetConVarInt( MoneyPerKnifeKill ) )
				}
			}

			if( GetConVarInt( HpKnifeKill ) > 0 &&  GetClientHealth( attacker ) < GetConVarInt( MaxHP ) ) {
				new ClientHealth = GetClientHealth( attacker )
				ClientHealth += GetConVarInt( HpKnifeKill )

				if( ClientHealth > GetConVarInt( MaxHP ) ) {
					ClientHealth = GetConVarInt( MaxHP ) 
				}

				SetEntProp( attacker, Prop_Data, "m_iHealth", ClientHealth )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved\x06 %d HP\x10 for killing an enemy!", GetConVarInt( HpKnifeKill ) )
				}					
			}
		}
		else {
			if( GetConVarInt( MoneyPerNormalKill ) > 0 && MoneyOffset != -1 ) {
				SetEntProp( attacker, Prop_Send, "m_iAccount", GetEntProp( attacker, Prop_Send, "m_iAccount" ) + GetConVarInt( MoneyPerNormalKill ) )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved extra\x06 $%d\x10 for killing an enemy!", GetConVarInt( MoneyPerNormalKill ) )
				}
			}

			if( GetConVarInt( HpNormalKill ) > 0 && GetClientHealth( attacker ) < GetConVarInt( MaxHP ) ) {
				new ClientHealth = GetClientHealth( attacker )
				ClientHealth += GetConVarInt( HpNormalKill )

				if( ClientHealth > GetConVarInt( MaxHP ) ) {
					ClientHealth = GetConVarInt( MaxHP ) 
				}

				SetEntProp( attacker, Prop_Data, "m_iHealth", ClientHealth )

				if( GetConVarBool( Notify ) ) {
					PrintToChat( attacker, " \x04[VIP]\x10 You recieved\x06 %d HP\x10 for killing an enemy!", GetConVarInt( HpNormalKill ) )
				}					
			}
		}
	}

	return Plugin_Continue
}

public Event_PhaseEnd( Handle: event, const String: name[ ], bool: dontBroadcast ) { 
	IsPistolRound = true
}

public Event_BeginDefuse( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && !IsPistolRound ) {
		new client = GetClientOfUserId( GetEventInt( event,"userid" ) )

		if( client > 0 && client < MaxClients && IsPlayerAlive( client ) && IsClientVip( client ) && GetConVarBool( HalfDefuseTimeKit ) || GetConVarBool( HalfDefuseTimeNoKit ) ) {
			CreateTimer( 0.0, DefuseBugFix, client )
		}
	}
}

public Event_BeginPlant( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && !IsPistolRound ) {
		new client = GetClientOfUserId( GetEventInt( event, "userid" ) )

		if( client > 0 && client < MaxClients && IsPlayerAlive( client ) && IsClientVip( client ) && GetConVarBool( HalfPlantTime ) ) {
			new Bomb = GetEntPropEnt( client, Prop_Send, "m_hActiveWeapon" )

			decl String: EntityName[ 20 ]
			GetEntityClassname( Bomb, EntityName, sizeof( EntityName ) )

			if( StrEqual( EntityName, "weapon_c4", false ) ) {
				SetEntPropFloat( Bomb, Prop_Send, "m_fArmedTime", GetGameTime()+GetConVarFloat( HalfPlantTime ) )
			}
		}
	}
}

public Event_BombPlanted( Handle: event, const String: name[ ], bool: dontBroadcast ) {
	if( GetConVarBool( PistolRoundRule ) && !IsPistolRound ) {
		if( GetConVarBool( ShowBombsite ) ) {
			new client = GetClientOfUserId( GetEventInt( event, "userid" ) )

			decl String: Bombsite[ 64 ]
			GetEntPropString( client, Prop_Send, "m_szLastPlaceName", Bombsite, sizeof( Bombsite ) )

			decl String: BombsiteBuffer[ 32 ]

			if( StrContains( Bombsite, "BombsiteA" ) != -1 ) {
				Format( BombsiteBuffer, sizeof( BombsiteBuffer ), "Bombsite A" )
			}
			else if( StrContains( Bombsite, "BombsiteB" ) != -1 ) {
				Format( BombsiteBuffer, sizeof( BombsiteBuffer ), "Bombsite B" )
			}

			for( new i = 1; i < MaxClients; i++ ) {
				if( IsClientInGame( i ) && IsClientVip( i ) && GetClientTeam( i ) == 3 && IsPlayerAlive( i ) ) {
					PrintToChat( i, " \x04[VIP]\x02 %N\x10 has planted the bomb in\x04 %s", client, BombsiteBuffer )
				}
			}
		}
	}
}

public Event_RoundEnd( Handle: event, const String: name[ ], bool: dontBroadcast ) { 
	RoundID++

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

public Action: OnPlayerRunCmd( client, &buttons, &impulse, Float: vel[ 3 ], Float: angles[ 3 ], &weapon ) {	
	if( IsClientVip( client ) && GetConVarBool( Bhop ) && CanBhop[ client ] ) {
		if( buttons & IN_JUMP && IsPlayerAlive( client ) && !( GetEntityFlags( client ) & FL_ONGROUND ) && !( GetEntityMoveType( client ) & MOVETYPE_LADDER ) ) {
			buttons &= ~IN_JUMP
		}
	}
}

public Action: DefuseBugFix( Handle: timer, any: client ) {
	if( client > 0 && client < MaxClients && IsClientInGame( client ) && IsPlayerAlive( client ) ) {
		new Bomb = FindEntityByClassname( MaxClients+1, "planted_c4" )

		if( Bomb != -1 ) {
			if( GetEntProp( client, Prop_Send, "m_bHasDefuser" ) ) {
				SetEntPropFloat( Bomb, Prop_Send, "m_flDefuseCountDown", GetGameTime( ) + GetConVarFloat( HalfDefuseTimeKit ) )

				SetEntPropFloat( client, Prop_Send, "m_flProgressBarStartTime", GetGameTime( ) ) 
				SetEntProp( client, Prop_Send, "m_iProgressBarDuration", GetConVarInt( HalfDefuseTimeKit ) )
			}
			else {
				SetEntPropFloat( Bomb, Prop_Send, "m_flDefuseCountDown", GetGameTime( ) + GetConVarFloat( HalfDefuseTimeNoKit ) )

				SetEntPropFloat( client, Prop_Send, "m_flProgressBarStartTime", GetGameTime( ) )  
				SetEntProp( client, Prop_Send, "m_iProgressBarDuration", GetConVarInt( HalfDefuseTimeNoKit ) )
			}
		} 
	}
}

public GiveSpawnItems( client ) {
	if( client > 0 && client < MaxClients && IsClientInGame( client ) && IsPlayerAlive( client ) && GetClientTeam( client ) > 1 ) {
		if( GetConVarBool( Armor ) ) {
			SetEntProp( client, Prop_Send, "m_ArmorValue", 100 )
		}

		if( GetConVarBool( Helmet ) && GetEntProp( client, Prop_Send, "m_ArmorValue" ) >= 1 ) {
			SetEntProp( client, Prop_Send, "m_bHasHelmet", 1 )
		}

		if( GetConVarBool( HE ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 14 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			GivePlayerItem( client, "weapon_hegrenade" )
		}

		if( GetConVarBool( Flash ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 15 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			GivePlayerItem( client, "weapon_flashbang" )
		}

		if( GetConVarBool( Smoke ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 16 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			GivePlayerItem( client, "weapon_smokegrenade" )
		}

		if( GetConVarBool( Molotov ) && GetEntProp( client, Prop_Send, "m_iAmmo", _, 17 ) < 1 && GetClientGrenades( client ) < GetConVarInt( FindConVar( "ammo_grenade_limit_total") ) ) {
			switch( GetClientTeam( client ) ) {
				case 2: {
					GivePlayerItem( client, "weapon_molotov" )
				}
				case 3: {
					GivePlayerItem( client, "weapon_incgrenade" )
				}
			}
		}

		if( GetConVarBool( ExtraMoneyOnSpawn ) && MoneyOffset != -1 ) {
			SetEntProp( client, Prop_Send, "m_iAccount", GetEntProp( client, Prop_Send, "m_iAccount" ) + GetConVarInt( ExtraMoneyOnSpawn ) )
		}

		if( GetConVarBool( Defuser ) && GetClientTeam( client ) == 3 && GetEntProp( client, Prop_Send, "m_bHasDefuser" ) < 1 ) {
			SetEntProp( client, Prop_Send, "m_bHasDefuser", 1 )
		}
	}
}

public Action: Command_ToggleBhop( client, args ) {
	if( GetConVarBool( PistolRoundRule ) && IsPistolRound ) {
		PrintToChat( client, " \x04[VIP]\x10 Auto-bhop cannot be used in pistol rounds!" )
		return Plugin_Handled
	}
	
	if( GetConVarBool( Bhop ) && IsClientVip( client ) ) {
		if( CanBhop[ client ] ) {
			CanBhop[ client ] = false
			SetClientCookie( client, BhopCookie, "0" )

			PrintToChat( client, " \x04[VIP]\x10 Auto-bhop was\x02 disabled\x10!" )
		}
		else {
			CanBhop[ client ] = true
			SetClientCookie( client, BhopCookie, "1" )

			PrintToChat( client, " \x04[VIP]\x10 Auto-bhop was\x06 enabled\x10!" )
		}
	}
	else {
		PrintToChat( client, " \x04[VIP]\x10 You need to be\x06 VIP\x10 to use this command!" )
	}

	return Plugin_Continue
}

public Action: Command_ShowVips( client, args ) {
	new Handle: OnlineVips = CreateMenu( OnlineVips_Handler )
	SetMenuTitle( OnlineVips, "Online VIPS List" )

	new OnlineVipsNum

	for( new i = 1; i < MaxClients; i++ ) {
		if( IsClientInGame( i ) && IsClientVip( i ) ) {
			decl String: uNameBuffer[ 32 ]
			Format( uNameBuffer, sizeof( uNameBuffer ), "%N", i )

			AddMenuItem( OnlineVips, "OnSelect", uNameBuffer, ITEMDRAW_DISABLED )

			OnlineVipsNum++
		}
	}

	if( OnlineVipsNum < 1 ) {
		if( OnlineVips != INVALID_HANDLE ) {
			CloseHandle( OnlineVips )
		}

		PrintToChat( client, " \x04[VIP]\x10 There are no vips online!" )
	}
	else {
		SetMenuExitButton( OnlineVips, true )
		DisplayMenu( OnlineVips, client, 30 )
	}
}

public OnlineVips_Handler( Handle: OnlineVips, MenuAction: action, client, menu ) {
	switch( action ) {
		case MenuAction_End: {
			if( OnlineVips != INVALID_HANDLE ) {
				CancelMenu( OnlineVips )
			}
		}
	}
}

public Action: WeaponSwitchPost( client, weapon ) {
	if( IsClientVip( client ) && IsPlayerAlive( client ) && GetConVarBool( VipSpeed ) ) {
		SetEntPropFloat( client, Prop_Send, "m_flVelocityModifier", GetConVarFloat( SpeedAmmount ) )
	}
}

public Action: OnTakeDamage( victim, &attacker, &inflictor, &Float:damage, &damagetype ) { 
	if( inflictor > 0 && inflictor < MaxClients && IsClientInGame( inflictor ) && GetClientTeam( inflictor ) != GetClientTeam( victim ) ) {
		if( IsClientVip( inflictor ) && GetConVarBool( Damage ) ) { 
			damage = ( damage * GetConVarInt( DamageAmount ) )
			return Plugin_Changed
		} 
	}

	return Plugin_Continue
}

stock bool: IsClientVip( client ) {
	if( GetUserFlagBits( client ) & VIP_FLAG ) {
		return true
	}

	return false
}

stock GetClientGrenades( client ) {
	new Explosive = GetEntProp( client, Prop_Send, "m_iAmmo", _, 14 )
	new Flashbang = GetEntProp( client, Prop_Send, "m_iAmmo", _, 15 )
	new Smokegrenade = GetEntProp( client, Prop_Send, "m_iAmmo", _, 16 )
	new Incendiary = GetEntProp( client, Prop_Send, "m_iAmmo", _, 17 )
	new Decoy = GetEntProp( client, Prop_Send, "m_iAmmo", _, 18 )

	return Explosive + Flashbang + Smokegrenade + Incendiary + Decoy
}

stock RemoveClientGrenades( client ) {
	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 14 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 14 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 15 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 15 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 16 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 16 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 17 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 17 )
	}

	if( GetEntProp( client, Prop_Send, "m_iAmmo", _, 18 ) >= 1 ) {
		SetEntProp( client, Prop_Send, "m_iAmmo", 0, _, 18 )
	}
}
Informatii Plugin (beneficii)
  • Cam tot ce contine acest VIP este controlabil cu ajutorul convar-urilor, fara sa fie necesare editari ale sursei!
  • Are suport pentru rundele de pistoale, se poate seta ca pluginul sa nu ruleze in rundele de pistoale,
  • Jucatorii VIP au auto-bhop care si-l pot dezactiva sau activa cu ajutorul unei comenzi (doar daca auto-bhop este permis prin convar),
  • Jucatorii VIP pot primi armura mica la spawn,
  • Jucatorii VIP pot primit casca la spawn, doar daca au deja armura pe ei,
  • Jucatorii VIP de la CT pot primi defuse kit la spawn,
  • Jucatorii VIP pot primit bani la spawn,
  • Jucatorii VIP pot primi un set cu grenazi la fiecare spawn (1x HE, 1x Flash, 1x Molotov/Incendiary si 1x Smoke)
    Daca rulati un server casual nemodificat, unde poti avea maxim 3 grenazi jucatorii vor primi maximul de grenazi permise de server, iar surplusul nu va fi dropat pe jos,
  • Jucatorii VIP pot primii HP atunci cand fac frag, in functie de frag-ul facut (HeadShot, kill cu lama, kill simplu),
  • Jucatorii VIP pot primii bani in plus atunci cand fac frag, in functie de frag-ul facut (HeadShot, kill cu lama, kill simplu),
  • Jucatorii VIP de la tero pot planta bomba mai repede decat un jucator normal,
  • Jucatorii VIP de la CT pot da defuse bombei mai repede decat un jucator normal,
  • Jucatorii VIP pot avea damage mai mare decat restul jucatorilor (disponibil de la versiunea 1.2),
  • Jucatorii VIP pot avea viteza de miscare mai mare decat restul jucatorilor (disponibil de la versiunea 1.1)
  • Jucatorii normali, cat si vipii, pot vedea ce vipi sunt online cu ajutorul comenzii !vips (disponibil de la versiunea 1.1),
  • Jucatorii VIP de la CT pot vedea in chat in ce bombsite s-a plantat bomba, dupa ce o planteaza teroristul.
Convar-uri (se adauga in autoexec.cfg)
  • vip_give_armor - Daca este setat pe 1, jucatorii VIP vor primi 100 armura la fiecare spawn. Default: 1
  • vip_give_helmet - Daca este setat pe 1, jucatorii VIP vor primi casca la fiecare spawn, daca au deja armura. Default: 1
  • vip_autobhop - Daca este setat pe 1, jucatorii VIP pot avea auto-bhop. Default: 1
  • vip_give_ct_defuser - Daca este setat pe 1, jucatorii VIP de la CT vor primi defuser la fiecare spawn, daca nu au deja unul. Default: 1
  • vip_give_he - Daca este setat pe 1, jucatorii VIP vor primi cate un HE grenade la fiecare spawn. Default: 1
  • vip_give_flash - Daca este setat pe 1, jucatorii VIP vor primi cate un flash la fiecare spawn.
    Default: 1
  • vip_give_molotov - Daca este setat pe 1, jucatorii VIP vor primi cate un molotov/incendiary la fiecare spawn. Default: 1
  • vip_give_smoke - Daca este setat pe 1, jucatorii VIP vor primi cate un smoke la fiecare spawn.
    Default: 1
  • vip_give_money_on_spawn <suma> - Jucatorii VIP vor primi suma de bani respectiva la fiecare spawn. Default: 500
  • vip_normal_kill_hp - HP-ul primit de VIP atunci cand face un frag simplu. Default: 10
  • vip_knife_kill_hp - HP-ul primit de VIP atunci cand face un frag cu cutitul. Default: 30
  • vip_headshot_hp - HP-ul primit de VIP atunci cand face un frag cu headshot. Default: 15
  • vip_max_hp - HP-ul maxim pe care il poate avea un VIP. Default: 100
  • vip_normal_kill_money <suma> - Suma de bani pe care o primeste VIP cand face un frag simplu. Default: 100
  • vip_knife_kill_money <suma> - Suma de bani pe care o primeste VIP atunci cand face frag cu cutitul. Default: 1000
  • vip_headshot_kill_money <suma> - Suma de bani pe care o primeste VIP atunci cand face frag cu headshot. Default: 150
  • vip_bomb_plant_time <timp> - Cat timp (in secunde) sa dureze plantarea bombei la un VIP. Default: 2 (timp-ul default al jocului este 3.9 secunde)
  • vip_defuse_time_nokit <timp> - Cat timp (in secunde) sa dureze dezamorsarea bombei de catre un VIP care nu are kit. Default 5 (timp-ul default al jocului este de 10 secunde)
  • vip_defuse_time_kit <timp> - Cat timp (in secunde) sa dureze dezamorsarea bombei de catre un VIP care are kit. Default: 2.5 (timp-ul default al jocului este de 5 secunde)
  • vip_disabled_on_pistol_round - Daca este setat pe 1, pluginul nu va rula in rundele de pistoale. Default: 1
  • vip_show_bombsite - Daca este setat pe 1, VIP in viata, de la CT, pot vedea in chat in ce bombsite au plantat teroristii bomba. Default: 1
  • vip_notify_on_bonus - Daca este setat pe 1, VIP va fie informat printr-un mesaj in chat atunci cand primeste un bonus specific VIP-ului (cum ar fi bani, hp). Default: 1
  • vip_fast_speed - Daca este setat pe 1, VIP vor avea viteza de miscare mai mare. Default: 1
  • vip_speed_amount - Valoarea multiplicatorului de viteza (vezi pagina 2 pentru detalii). Default 1.2
  • vip_high_damage - Daca este setat pe 1, VIP vor avea damage mai mare decat restul jucatorilor
  • vip_damage_amount - Valoarea multiplicatorului de damage (vezi pagina 3 pentru detalii). Default 2 (damage dublu)
Oricare dintre convar-urile de mai sus pot fi dezactivate daca sunt setate pe o valoare mai mica decat 1 (cum ar fi 0). La convar-urile de plantare si dezamorsare a bombei, daca sunt setate pe 1 va rezulta in plantarea/dezamorsarea instanta a bombei!

Comenzi
  • !bhop - poate fi folosita de catre VIP atunci cand vor sa-si activeze sau sa-si dezactiveze auto-bhop-ul,
    !vips - poate fi folosita de oricine. Cu ajutorul acestei comenzi poti vedea vipii online intr-un meniu.
Changelog
  • Versiunea 1.1:
    • A fost adaugata comanda !vips ce arata vipii online intru-un meniu
    • A fost adaugata viteza ce poate fi controlata prin convar-uri
    • A fost adaugat convar-ul vip_fast_speed ce activeaza sau dezactiveaza viteza la vipilor
    • A fost adaugat convar-ul vip_speed_ammount ce controleaza multiplicatorul de viteza al vipilor
    Versiunea 1.2
    • A fost adaugat damage ce poate fi controlat prin convar-uri
    • A fost adaugat convar-ul vip_high_damage ce activeaza sau dezactiveaza damage-ul marit al vipilor
    • A fost adaugat convar-ul vip_damage_amount ce controleaza multiplicatorul de damage al vipilor
    • Convarul vip_speed_ammount a fost modificat in vip_speed_amount. Face acelasi lucru, doar numele a fost schimbat. Cei care faceti update, nu uitati sa modificati si numele acestui convar in autoexec.cfg
Rezolvare spam din consola
In cazul in care sunteti spamati in consola cu mesaje de genul:

Code: Select all

DataTable warning: player: Out-of-range value (1.20000000) in SendPropFloat 'm_flVelocityModifier', clamping.
Acele mesaje nu va afecteaza cu nimic, nu sunt erori, sunt warning-uri, ceea ce inseamna ca este un simplu text si nu iti afecteaza serverul cu nimic. Daca totusi te enerveaza acel spam, pentru a scapa de el trebuie sa instalezi extensia Cleaner pe care o puteti descarca de aici: https://forums.alliedmods.net/showthread.php?t=195008

Instalare
1. Fisierul csgo_vip.sp se adauga in addons/sourcemod/scripting
2. Fisierul csgo_vip.smx se adauga in addons/sourcemod/plugins

Orice modificare se cere si se ofera in acest topic, nu in PM. Raportarile de buguri se fac tot in acest topic. De preferat sa fie insotite de erorile din log-uri sau o poza / video daca nu sunt erori.
Last edited by tre3fla on 23 Sep 2017, 17:54, edited 5 times in total.
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

20 Sep 2017, 11:56

Ar fi bine sa adaugi si un motd cu beneficii gen un player care nu are vip sa poata vedea ce contine acestea
User avatar
OXYD
Membru, skill +1
Membru, skill +1
Posts: 463
Joined: 27 May 2017, 21:38
Detinator Steam: Da
CS Status: Playing CS:GO
Detinator server CS: Go.HellHounds.Ro
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Fond eXtream: 0
Been thanked: 1 time
Contact:

20 Sep 2017, 13:07

#Vali wrote:Ar fi bine sa adaugi si un motd cu beneficii gen un player care nu are vip sa poata vedea ce contine acestea
Poftim
| Afiseaza codul
#include <hattrick_csgo>
#include <clientprefs>

public Plugin myinfo =
{
	name = "vipinfo_rulzgame",
	author = "care *** o fi",
	description = "VIP Info",
	version = "1.0",
	url = "http://rulzgame.com"
};

public void OnPluginStart()
{
	CreateTimer(9.0 * 60.0, Timer_VIP_Details, _, TIMER_REPEAT);
}

public Action Timer_VIP_Details(Handle pTimer, any _Data)
{
	if (GetRandomInt(0, 1) == 0)
		PrintToChatAll("\x01 \x09[VIP★ INFO]\x04  TYPE\x03  !INFO\x04  FOR ALL\x03  VIP★\x04  INFORMATION");
				
	else
		PrintToChatAll("\x01 \x09[VIP★ INFO]\x04  SCRIE\x03  !INFO\x04  PENTRU TOATE DETALIILE\x03  VIP★");
}

public void OnClientSayCommand_Post(int iId, const char[] szCmd, const char[] szArgs)
{
	static char szBuffer[PLATFORM_MAX_PATH];
	static char szMap[PLATFORM_MAX_PATH];
	
	static Handle pMenu;
	
	if (iId >= 1 && iId <= MaxClients && IsClientInGame(iId))
	{
		if (StrContains(szCmd, "Say", false) != -1)
		{
			FormatEx(szBuffer, sizeof(szBuffer), szArgs);
			
			hCSGO_ClearLine(szBuffer);
			
			if (!strcmp(szBuffer, "info", false) || !strcmp(szBuffer, "!info") || !strcmp(szBuffer, "/info") || \
					!strcmp(szBuffer, "vipinfo", false) || !strcmp(szBuffer, "!vipinfo") || !strcmp(szBuffer, "/vipinfo") || \
					!strcmp(szBuffer, "preturi", false) || !strcmp(szBuffer, "!preturi") || !strcmp(szBuffer, "/preturi") || \
					!strcmp(szBuffer, "about", false) || !strcmp(szBuffer, "!about") || !strcmp(szBuffer, "/about") || \
					!strcmp(szBuffer, "despre", false) || !strcmp(szBuffer, "!despre") || !strcmp(szBuffer, "/despre") || \
					!strcmp(szBuffer, "details", false) || !strcmp(szBuffer, "!details") || !strcmp(szBuffer, "/details") || \
					!strcmp(szBuffer, "pret", false) || !strcmp(szBuffer, "!pret") || !strcmp(szBuffer, "/pret"))
			{
				GetCurrentMap(szMap, sizeof(szMap));
				
				if (szMap[0] == 'z' || szMap[0] == 'Z')
				{
					pMenu = CreateMenu(__Handler);
					
					SetMenuTitle(pMenu, "—— VIP★ INFO (5€, 10€, 20€) ——");
					
					AddMenuItem(pMenu, "", "→ V.I.P FEATURES [✘] ←", ITEMDRAW_DISABLED);
					AddMenuItem(pMenu, "", "TAG in Chat");
					AddMenuItem(pMenu, "", "Access for Sounds");
					AddMenuItem(pMenu, "", "110 HP");
					AddMenuItem(pMenu, "", "150 Armour");
					AddMenuItem(pMenu, "", "VIP Menu With Bhop/Guns");
					AddMenuItem(pMenu, "", "IMMUNITY 30");
					AddMenuItem(pMenu, "", "Join Sound - 2 euro");
					AddMenuItem(pMenu, "", "→ PayPal, CS:GO Skin,PaySafe ←", ITEMDRAW_DISABLED);
					
					DisplayMenu(pMenu, iId, MENU_TIME_FOREVER);
				}
				
				else
				{
					pMenu = CreateMenu(__Handler);

					AddMenuItem(pMenu, "", "→ V.I.P FEATURES [✘] ←", ITEMDRAW_DISABLED);
					AddMenuItem(pMenu, "", "TAG in Chat");
					AddMenuItem(pMenu, "", "Access for Sounds");
					AddMenuItem(pMenu, "", "110 HP");
					AddMenuItem(pMenu, "", "150 Armour");
					AddMenuItem(pMenu, "", "VIP Menu With Bhop/Guns");
					AddMenuItem(pMenu, "", "IMMUNITY 30");
					AddMenuItem(pMenu, "", "Join Sound - 2 euro");
					AddMenuItem(pMenu, "", "→ PayPal, CS:GO Skin,PaySafe ←", ITEMDRAW_DISABLED);
		
					DisplayMenu(pMenu, iId, MENU_TIME_FOREVER);
				}
			}
			
			else if (StrContains(szBuffer, "VIP", false) != -1)
			{
				if (GetRandomInt(0, 1) == 0)
					PrintToChat(iId, "\x01 \x09[VIP★ INFO]\x04  TYPE\x03  !INFO\x04  FOR ALL\x03  VIP★\x04  INFORMATION");
				
				else
					PrintToChat(iId, "\x01 \x09[VIP★ INFO]\x04  SCRIE\x03  !INFO\x04  PENTRU TOATE DETALIILE\x03  VIP★");
			}
		}
	}
}

public int __Handler(Handle pMenu, MenuAction pAction, int iId, int iOption)
{
	if (pAction == MenuAction_End)
	{
		CloseHandle(pMenu);
		pMenu = INVALID_HANDLE;
	}
}
User avatar
FREAK
Membru, skill +4
Membru, skill +4
Posts: 1846
Joined: 13 Aug 2016, 19:46
Detinator Steam: Da
CS Status: Ma joc CS:GO
Detinator server CS: ARENA.1TAP.RO
SteamID: freakav
Reputatie: Fost Scripter eXtreamCS
Fost Membru Club eXtreamCS (6 luni)
Nume anterior: FREAK OFFICIAL TV
Fond eXtream: 0
Location: England
Contact:

20 Sep 2017, 13:14

Domnu' OXYD stii sa citesti ? Baiatul vrea MOTD , MOTD este acea fereastra care se deschide printr-o comanda din chat , tu ce ai oferit acolo este sursa lui Hattrick care arata un MENIU nu MOTD. Nici macar o sursa nu esti in stare sa citesti
User avatar
rinka124
Membru, skill 0
Membru, skill 0
Posts: 47
Joined: 11 Jun 2017, 16:07
Detinator Steam: Da
CS Status: :/
Detinator server CS: xd.rinkau.ro
SteamID: STEAM_0:1:208463495
Fond eXtream: 0
Location: Bascauti
Contact:

20 Sep 2017, 13:22

#Vali wrote:Ar fi bine sa adaugi si un motd cu beneficii gen un player care nu are vip sa poata vedea ce contine acestea
Poti lua web shortcut-urile si sa iti faci singur un motd sau poti mai bine cu un meniu ca cel care l-a lasat oxid :D , parerea mea , frumos plugin @tr3fla
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

20 Sep 2017, 13:44

Nu vreau pentru mine, era o ideea pentru un eventual update.
User avatar
OXYD
Membru, skill +1
Membru, skill +1
Posts: 463
Joined: 27 May 2017, 21:38
Detinator Steam: Da
CS Status: Playing CS:GO
Detinator server CS: Go.HellHounds.Ro
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Fond eXtream: 0
Been thanked: 1 time
Contact:

20 Sep 2017, 14:00

FREAK wrote:Domnu' OXYD stii sa citesti ? Baiatul vrea MOTD , MOTD este acea fereastra care se deschide printr-o comanda din chat , tu ce ai oferit acolo este sursa lui Hattrick care arata un MENIU nu MOTD. Nici macar o sursa nu esti in stare sa citesti
Altceva decat sa te iei de toti nu ai? NU trebuie sa imi explici ce-i ala MOTD ca stiu si eu , inafara de sa-ti pierzi viata pe net nu ai? Du-te pe centura in Anglia , poate mai faci si tu niste bani cinstiti.
I-am oferit ceva mai bun chiar , pentru ca nu toti au cl_disablehtmlmotd pe 0
Last edited by Edi. on 20 Sep 2017, 18:23, edited 1 time in total.
Reason: Ai primit avertisment pentru limbaj.
FzR?
Membru, skill +1
Membru, skill +1
Posts: 494
Joined: 15 Aug 2017, 16:56
Detinator Steam: Da
CS Status: Dota2 :)
Detinator server CS: Jb.1TAP.ro
SteamID: fzrcsgo
Fond eXtream: 0
Location: Constanta
Been thanked: 7 times
Contact:

20 Sep 2017, 15:00

Salut este pe flag sau trebuie adaugat din consola sa stiu daca il incerc acum sau mai pe seara :D .

Poti adauga si Double Jump ;)

Nice .
User avatar
tre3fla
Membru eXtream
Membru eXtream
Posts: 5333
Joined: 27 May 2012, 10:15
Detinator Steam: Da
CS Status: Allah Akbar !
Detinator server CS: Nu
SteamID: /id/tre3fla_xxx
Has thanked: 14 times
Been thanked: 129 times

20 Sep 2017, 15:17

FzR? wrote:Salut este pe flag sau trebuie adaugat din consola sa stiu daca il incerc acum sau mai pe seara :D .

Poti adauga si Double Jump ;)

Nice .

Code: Select all

#define VIP_FLAG ADMFLAG_CUSTOM1
Flagul custom1 este flagul "o". Nu trebuie sa adaugi nimic in consola.
FzR?
Membru, skill +1
Membru, skill +1
Posts: 494
Joined: 15 Aug 2017, 16:56
Detinator Steam: Da
CS Status: Dota2 :)
Detinator server CS: Jb.1TAP.ro
SteamID: fzrcsgo
Fond eXtream: 0
Location: Constanta
Been thanked: 7 times
Contact:

20 Sep 2017, 18:34

ok mersi nu bagasem am crezut ca ,trebuie adaugat manual si cum cfg se creeaza dupa schimbarea mapei nu am vrut sa schimb sistemul actual revin cu impresii :D poate te gandesti si un double jump pe viitor
Last edited by FzR? on 20 Sep 2017, 21:18, edited 1 time in total.
User avatar
sound
Membrul anului 2018
Membrul anului 2018
Posts: 5845
Joined: 23 Jan 2013, 22:52
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: Nu
SteamID: sou_nd
Reputatie: Fost membru Club eXtreamCS (4 luni)
Nume anterioare: s o u n d -, snd
Fost Moderator
Fost Super Moderator
Moderatorul anului 2017
Membrul anului 2018
Fond eXtream: 0
Location: Romania
Has thanked: 90 times
Been thanked: 78 times
Contact:

20 Sep 2017, 19:57

super tare
User avatar
The Kalu
eXtream Mod
eXtream Mod
Posts: 12970
Joined: 09 Oct 2010, 11:39
Detinator Steam: Da
CS Status: In grajd!
SteamID: kalulord
Reputatie: Fost membru Club eXtreamCS (6 luni)
Nume anterior: Terra
Location: Romania, Ploiesti
Has thanked: 248 times
Been thanked: 488 times
Contact:

20 Sep 2017, 20:24

Felicitari Trefla, tine-o tot asa!

Ca o mica paranteza, succes celor care n-au bani de pateu si le vand pe cand se gasesc gratis.
Like, share and enjoy!
@citatememorabile
Image
Post Reply

Return to “Pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests