Created
October 19, 2016 19:06
-
-
Save hitmany/60cdc9c0f68f4523686114682636d467 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sourcemod> | |
#include <sdkhooks> | |
#include <sdktools> | |
public Plugin myinfo = | |
{ | |
name = "Grenade as chicke", | |
author = "hitmany", | |
description = "Grenade as chicken", | |
version = "1.0", | |
url = "http://www.sourcemod.net/" | |
}; | |
public OnEntityCreated(entity, const String:classname[]) | |
{ | |
if (strcmp(classname, "hegrenade_projectile", false) == 0) | |
{ | |
CreateTimer(0.1, GrenChicken, entity); | |
} | |
} | |
public Action:GrenChicken(Handle:timer, any:entity) | |
{ | |
new owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity"); | |
if (owner != -1) | |
{ | |
new Float:pos[3]; | |
GetEntPropVector(entity, Prop_Data, "m_vecOrigin", pos); | |
new iHe = CreateEntityByName("chicken"); | |
if (iHe != -1) | |
{ | |
DispatchSpawn(iHe); | |
TeleportEntity(iHe, pos, NULL_VECTOR, NULL_VECTOR); | |
} | |
AcceptEntityInput(entity, "kill"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment