Raised This Month: $ Target: $400
 0% 

Chest no block players [Pirates, vikings, knight II]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-15-2023 , 17:49   Re: Chest no block players [Pirates, vikings, knight II]
Reply With Quote #2

Try this
PHP Code:
#include <sdktools>
#include <sdkhooks>

#define COLLISION_GROUP_DEBRIS        1 // trigger not work
#define COLLISION_GROUP_DEBRIS_TRIGGER        2
#define COLLISION_GROUP_WEAPON        11

public void OnPluginStart()
{
    
HookEvent("chest_respawn"chest);
}


public 
void OnEntityCreated(int entity, const char[] classname)
{
    if(
StrEqual(classname"weapon_chest"false))
        
SDKHook(entitySDKHook_SpawnPostSpawnPost);
}

public 
void SpawnPost(int entity)
{
    
int ref EntIndexToEntRef(entity);
    
    if(
ref != -1)
        
RequestFrame(delayref);
}

public 
void chest(Event event, const char[] namebool dontBroadcast)
{
    
int entity event.GetInt("chestid");

    
int ref EntIndexToEntRef(entity);

    if(
ref != -1)
        
RequestFrame(delayref);
}

public 
void delay(any data)
{
    
SetCollisionGroup(dataCOLLISION_GROUP_DEBRIS_TRIGGER);
}

void SetCollisionGroup(int refint collisionGroup)
{
    if(
IsValidEntity(ref) && IsValidEdict(ref))
    {
        
SetEntProp(refProp_Send"m_CollisionGroup"collisionGroup);
        
//PrintToServer("SetCollisionGroup %i", ref);
    
}

...those chests, what spawn on top of small pilar. Pilar have higher colllision box what block player, chest itself can lay top of pilar. If you wonder.
__________________
Do not Private Message @me

Last edited by Bacardi; 03-15-2023 at 17:49.
Bacardi is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode