AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved [L4D2] Glowing ammunition problem (https://forums.alliedmods.net/showthread.php?t=331938)

leaffan 04-14-2021 13:39

[L4D2] Glowing ammunition problem
 
1 Attachment(s)
Hello guys, (Sorry, I don't speak English!)

The attached attachment also has a problem that you can see in the picture, it appears regardless of the map, whether the weapon or equipment ammunition is actually not there, but it still seems to exist. Can we fix this?

Picture: https://prnt.sc/11ea4nj
Picture: https://prnt.sc/11ea4nj

Marttt 04-14-2021 14:01

Re: [L4D2] Glowing ammunition problem
 
this happens because it is a "spawner" entity, you can check what I did in my [L4D2] Random Glow Item plugin.

I usually do this:

PHP Code:

public void OnEntityCreated(int entity, const char[] classname)
{
    if (
HasEntProp(entityProp_Data"m_itemCount")) // *_spawn entities
    
{
        
SDKHook(entitySDKHook_UsePostOnUsePost);
    }
}

public 
void OnUsePost(int entityint activatorint callerUseType typefloat value)
{
    
int count GetEntProp(entityProp_Data"m_itemCount");

    if (
count == 0)
        
AcceptEntityInput(entity"Kill");



leaffan 04-14-2021 14:03

Re: [L4D2] Glowing ammunition problem
 
Quote:

Originally Posted by Marttt (Post 2744069)
this happens because it is a "spawner" entity, you can check what I did in my [L4D2] Random Glow Item plugin.

I usually do this:

PHP Code:

public void OnEntityCreated(int entity, const char[] classname)
{
    if (
HasEntProp(entityProp_Data"m_itemCount")) // *_spawn entities
    
{
        
SDKHook(entitySDKHook_UsePostOnUsePost);
    }
}

public 
void OnUsePost(int entityint activatorint callerUseType typefloat value)
{
    
int count GetEntProp(entityProp_Data"m_itemCount");

    if (
count == 0)
        
AcceptEntityInput(entity"Kill");



Thank you.


All times are GMT -4. The time now is 23:40.

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