View Single Post
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 04-15-2019 , 12:30   Re: Crash AcceptEntityInput
Reply With Quote #2

Not tested but should work

PHP Code:
#pragma semicolon 1

#include <sdkhooks> 
#include <sdktools> 

public OnEntityCreatedentity, const String:classname[] )

    if( 
StrEqualclassname"weapon_p90" ) || StrEqualclassname"weapon_g3sg1" ) || StrEqualclassname"weapon_scar20" ) )
    { 
        
SDKHookentitySDKHook_SpawnHook_OnEntitySpawn ); 
    } 

public 
Action:Hook_OnEntitySpawnentity )
{     
    if(
IsValidEntityentity ) )
    {
        
RequestFrame(view_as<RequestFrameCallback>(KillEntity), EntIndexToEntRef(entity));
    }
    return 
Plugin_Continue;
}

void KillEntity(int entityReference)
{
    
AcceptEntityInput(entityReference"Kill" ); 

__________________

Last edited by impossible_cc; 04-25-2019 at 15:20.
impossible_cc is offline