AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   world model bug (https://forums.alliedmods.net/showthread.php?t=325967)

jugule 07-12-2020 15:42

world model bug
 
I use this function to set the model + effects for players, but after throwing the grenade, it no longer disappears from the ground, w_grenade.mdl remains on the ground.
How do I get rid of them?

PHP Code:

public FwdSetModel(iEntity, const szModel[])
{
    if( 
pev_valid(iEntity) && equal(szModel"models/w_hegrenade.mdl"))
    {                        
        
entity_set_model(iEntity"models/w_hegrenade.mdl");
        
set_pev(iEntitypev_dmgtime9999.0);
        
balls_effects(iEntity)
            
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

+++

public 
NadeTouch(ent,id)
{
        
        if(!
pev_valid(ent))
            return 
FMRES_IGNORED
        
        
//Create some variables
        
new classname[20],classname2[20],Float:origin[3],owner pev(ent,pev_owner)
        
        
pev(ent,pev_origin,origin)
        
pev(id,pev_classname,classname2,sizeof classname2 1)
        
pev(ent,pev_classname,classname,sizeof classname 1)
        
        
//Player get's hit
        
if(equali(classname,"grenade") && equali(classname2,"player"))
        {
            if(
is_user_alive(id))
            {                
            
                
engfunc(EngFunc_RemoveEntity,ent)
                
sw_kill(ownerid // effects on kill
                
}    
        }
        
    
    return 
FMRES_IGNORED
}


https://i.imgur.com/mWVcDU9.png

CrazY. 07-13-2020 08:53

Re: world model bug
 
Commenting the following lines should fix the problem
Code:
entity_set_model(iEntity, "models/w_hegrenade.mdl"); set_pev(iEntity, pev_dmgtime, 9999.0);


All times are GMT -4. The time now is 13:54.

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