Skip to content

Instantly share code, notes, and snippets.

@hitmany
Created October 19, 2016 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitmany/60cdc9c0f68f4523686114682636d467 to your computer and use it in GitHub Desktop.
Save hitmany/60cdc9c0f68f4523686114682636d467 to your computer and use it in GitHub Desktop.
#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