Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sdktools>
- #include <sdkhooks>
- #pragma newdecls required
- #pragma semicolon 1
- public void OnEntityCreated(int entity, const char[] classname)
- {
- if(strcmp(classname, "pipe_bomb_projectile") == 0 || strcmp(classname, "molotov_projectile") == 0 || strcmp(classname, "vomitjar_projectile") == 0)
- {
- SDKHook(entity, SDKHook_SpawnPost, SpawnPost);
- }
- }
- public void SpawnPost(int entity)
- {
- RequestFrame(nextFrame, EntIndexToEntRef(entity));
- }
- public void nextFrame(int entity)
- {
- if((entity = EntRefToEntIndex(entity)) != INVALID_ENT_REFERENCE )
- {
- float vAng[3], vVel[3];
- GetEntPropVector(entity, Prop_Data, "m_angRotation", vAng);
- GetEntPropVector(entity, Prop_Send, "m_vInitialVelocity", vVel);
- float vDir[3];
- GetAngleVectors(vAng, vDir, NULL_VECTOR, NULL_VECTOR);
- vAng[0] += GetRandomFloat(-50.0, 50.0);
- vAng[1] += GetRandomFloat(-50.0, 50.0);
- vAng[2] += GetRandomFloat(-50.0, 50.0);
- vVel[0] += GetRandomFloat(-100.0, 300.0);
- vVel[1] += GetRandomFloat(-100.0, 300.0);
- vVel[2] += GetRandomFloat(-100.0, 300.0);
- TeleportEntity(entity, NULL_VECTOR, vAng, vVel);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement