Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ORdli
Member
Join Date: Nov 2021
Old 03-15-2023 , 02:51   Chest no block players [Pirates, vikings, knight II]
Reply With Quote #1

Can anyone write a plugin that will allow players to freely walk through chests in this game? and that they don't block or push players? the game has a Weapon_Chest weapon in simple words, you need to remove the collision from this object so that players can no longer get stuck in it


https://forums.alliedmods.net/attachment.php?attachmentid=199917&stc=1&d=16 78863225[/IMG]

https://forums.alliedmods.net/attachment.php?attachmentid=199916&stc=1&d=16 78863225[/IMG]

Last edited by ORdli; 03-15-2023 at 02:58. Reason: edited
ORdli is offline
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
ORdli
Member
Join Date: Nov 2021
Old 03-16-2023 , 13:46   Re: Chest no block players [Pirates, vikings, knight II]
Reply With Quote #3

it works thanks, now there will be less bugs in the game!
ORdli is offline
Reply



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 20:23.


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