Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #pragma newdecls required
- #include sdktools
- bool All;
- public void OnMapStart()
- {
- All = true;
- }
- public void OnEntityDestroyed(int entity)
- {
- if(All)
- {
- if(IsValidEntity(entity) && IsValidEdict(entity))
- {
- char sWeaponEx[56];
- GetEntityClassname(entity, sWeaponEx, sizeof(sWeaponEx));
- if(strcmp(sWeaponEx, "grenade_launcher_projectile") == 0)
- {
- float vPos[3];
- GetEntPropVector(entity, Prop_Send, "m_vecOrigin", vPos);
- PointPush(vPos, 100.0, 150.0);
- }
- else if(strcmp(sWeaponEx, "pipe_bomb_projectile") == 0)
- {
- float vPos[3];
- GetEntPropVector(entity, Prop_Send, "m_vecOrigin", vPos);
- PointPush(vPos, 100.0, 150.0);
- }
- }
- }
- }
- public void PointPush(float center[3], float force, float radius)
- {
- int push = CreateEntityByName("point_push");
- DispatchKeyValueFloat(push, "magnitude", force);
- DispatchKeyValueFloat(push, "radius", radius);
- DispatchKeyValueFloat(push, "inner_radius", force*2);
- DispatchKeyValue(push, "spawnflags", "16");
- DispatchSpawn(push);
- TeleportEntity(push, center, NULL_VECTOR, NULL_VECTOR);
- AcceptEntityInput(push, "Enable", -1, -1);
- CreateTimer(0.1, DeletePushForce, push);
- }
- public Action DeletePushForce(Handle timer, int push)
- {
- if(IsValidEntity(push))
- AcceptEntityInput(push, "kill");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement