Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <sdkhooks>
- #define PLUGIN_VERSION "1.0"
- #pragma semicolon 1
- #pragma newdecls required
- public Plugin myinfo =
- {
- name = "L4D Kick Special Infected",
- author = "Alex Dragokas",
- description = "Kick Special Infected",
- version = "1.0",
- url = "https://github.com/dragokas"
- };
- int g_iLoadStatus = false;
- public void OnPluginStart()
- {
- g_iLoadStatus = 1;
- }
- public void OnMapStart()
- {
- g_iLoadStatus = 1;
- }
- public void OnMapEnd()
- {
- g_iLoadStatus = 0;
- }
- public void Event_RoundEnd(Handle event, const char[] name, bool dontBroadcast)
- {
- g_iLoadStatus = 0;
- }
- public void Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
- {
- g_iLoadStatus = 1;
- }
- public void OnPluginEnd()
- {
- g_iLoadStatus = 0;
- }
- public void OnEntityCreated(int entity, const char[] classname)
- {
- if( g_iLoadStatus == 0)
- return;
- if( strcmp(classname, "infected") == 0 )
- {
- SDKHook(entity, SDKHook_SpawnPost, OnSpawnCommon);
- }
- }
- public void OnSpawnCommon(int Ent)
- {
- if (IsSpecialInfected (Ent))
- {
- PrintToChatAll("Starting kicking...");
- }
- }
- bool IsSpecialInfected(int target)
- {
- if( target > 0 && target <= MaxClients && IsClientInGame(target) && GetClientTeam(target) == 3 )
- {
- int class = GetEntProp(target, Prop_Send, "m_zombieClass") + 1;
- if( class == 9 ) class = 8;
- PrintToChatAll("Spawned class: %i", class);
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement