AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Changing w_hegrenade model (https://forums.alliedmods.net/showthread.php?t=89691)

Sun Set 04-09-2009 12:16

Changing w_hegrenade model
 
I wanna change the model of the grenade when its thrown. I tried this but doesn't work

PHP Code:

public fw_SetModel(entity, const model[])
{


    static 
Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    if (
dmgtime == 0.0)
        return;

    if (
equal(model[7], "w_he"4))
        
engfunc(EngFunc_SetModelentitymodel_waura_shield)



xbatista 04-09-2009 12:20

Re: Changing w_hegrenade model
 
PHP Code:

public fwd_setmodel(ent, const model[]) 
{
    if(!
pev_valid(ent) || !equal(model[9], "smokegrenade.mdl"))
        return 
FMRES_IGNORED
    
    
static classname[32]; pev(entpev_classnameclassname31)
    if(
equal(classname"grenade") )
    {
        
engfunc(EngFunc_SetModelentg_flare_model)
        
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED



xPaw 04-09-2009 14:49

Re: Changing w_hegrenade model
 
PHP Code:

public fw_SetModeliEntityszModel[] ) {
    if( !
pev_validiEntity ) )
        return 
FMRES_IGNORED;
    
    if( 
equaliszModel"w_hegrenade.mdl" ) ) {
        new 
szClassname32 ];
        
peviEntitypev_classnameszClassname31 );
        
        if( 
equalszClassname"grenade" ) ) {
            
engfuncEngFunc_SetModeliEntitymodel_waura_shield );
            
            return 
FMRES_SUPERCED;
        }
    }
    
    return 
FMRES_IGNORED;



ConnorMcLeod 04-09-2009 16:18

Re: Changing w_hegrenade model
 
Quote:

Originally Posted by xPaw (Post 801679)
PHP Code:

public fw_SetModeliEntityszModel[] ) {
    if( !
pev_validiEntity ) )
        return 
FMRES_IGNORED;
    
    if( 
equalszModel"models/w_hegrenade.mdl" ) ) {
        
engfuncEngFunc_SetModeliEntitymodel_waura_shield );
            
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;



Fixed.

naSTR 02-06-2012 08:01

Re: Changing w_hegrenade model
 
Quote:

Originally Posted by ConnorMcLeod (Post 801731)
Fixed.

compile error
Code:

engfunc( EngFunc_SetModel, iEntity, model_waura_shield );
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "model_waura_shield" on line 14
Error: Number of arguments does not match definition on line 14

2 Errors.
Could not locate output file C:\Documents and Settings\Administrator\My Documents\zp_hegrenade.amx (compile failed).

can u make it for zombie plague?
if zombie w_hegranade2.mdl
if human w_hegranade3.mdl or back to default model :wink:


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

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