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

world model bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jugule
AlliedModders Donor
Join Date: Apr 2020
Old 07-12-2020 , 15:42   world model bug
Reply With Quote #1

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

Last edited by jugule; 07-12-2020 at 15:43.
jugule is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-13-2020 , 08:53   Re: world model bug
Reply With Quote #2

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









Last edited by CrazY.; 07-13-2020 at 08:54.
CrazY. 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:31.


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