AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Model overlay (https://forums.alliedmods.net/showthread.php?t=326666)

Mixtaz 08-11-2020 02:42

Model overlay
 
1 Attachment(s)
Hello, I'm running biohazard server by Cheap Suit.

He uses this weird method of applying models into player:

PHP Code:

if(!pev_valid(g_modelent[index]))
    {
        static 
ent
        ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
        if(
pev_valid(ent))
        {
            
engfunc(EngFunc_SetModelentDEFAULT_PMODEL)
            
set_pev(entpev_classnameMODEL_CLASSNAME)
            
set_pev(entpev_movetypeMOVETYPE_FOLLOW)
            
set_pev(entpev_aimentindex)
            
set_pev(entpev_ownerindex)
                
            
g_modelent[index] = ent
        
}
    }
    else
    {
        
engfunc(EngFunc_SetModelg_modelent[index], DEFAULT_PMODEL)
        
fm_set_entity_visibility(g_modelent[index], 1)
    } 

Nothing wrong with that, works fine and even overrides cl_minmodels 1 command.

However combined with frostnade plugin by Avalanche, when zombie gets frozen it gets both zombie and human model. I've done some debugging sessions and what appears to be problem is "set_user_rendering" function. I've modified the code a bit following Mercylezz tutorial, and it worked but when zombie was frozen, it no longer was glowing when hit.

Here is my edited version of frostnades, perhaps someone knows how to fix this

Black Rose 08-12-2020 18:11

Re: Model overlay
 
I'm pretty much guessing here.
You probably have to set the rendering on the model dummy entity instead of the player.
To get the entity, loop through them by classname "player_model" and compare pev_owner to the player id.
If there's no hit, use the player as the target entity. (If that is a possibility, I don't know)

Mixtaz 10-28-2020 07:18

Re: Model overlay
 
All I had to do was to made native that returns g_modelent and override the freeze method with it instead of player id. Good guess tho, thanks.


All times are GMT -4. The time now is 22:07.

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