View Single Post
Cruze
Veteran Member
Join Date: May 2017
Old 10-13-2020 , 03:58   Re: [CSGO] Turning Thrown Grenades Into Footballs
Reply With Quote #2

PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
    if(
StrContains(classname"_projectile") != -1SDKHook(entitySDKHook_SpawnPostGrenade_SpawnPost);
    if(
StrContains(classname"_projectile") != -1SDKHook(entitySDKHook_StartTouch, Catch);
}

public 
void Grenade_SpawnPost(int entity)
{
    
int client GetEntPropEnt(entityProp_Send"m_hOwnerEntity");
    if (
client == -1)return; // if the client's index is -1, stop
    
int iReference EntIndexToEntRef(entity);
    
CreateTimer(0.1Timer_OnGrenadeCreatediReference);
}

public 
Action Timer_OnGrenadeCreated(Handle timerany ref)
{
    
int entity EntRefToEntIndex(ref);
    if(
entity != INVALID_ENT_REFERENCE)
    {
        
SetEntProp(entityProp_Data"m_nNextThinkTick", -1); // block grenade explosion
        
SetEntProp(entityProp_Send"m_CollisionGroup"5);
    }
}

public 
void Catch (int clientint entity)
{
    if (!
IsValidEntity(entity))
        return;

    
PrintToChatAll("the football has hit something");    

Try this
__________________
Taking paid private requests! Contact me
Cruze is offline