AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   W_Model does not display (https://forums.alliedmods.net/showthread.php?t=193354)

retoxx 08-18-2012 15:05

W_Model does not display
 
I can hold a dodgeball and see other players have the dodgball but when we throw the dodgeball it becomes a hegrenade in air and then just lay on the ground.

I have tried Everything to make the w_hegrenade turn into a w_dodgeball but it just dosn't work.

PHP Code:

public think_grenade(ent

{
    
    new 
model[32];
    
    
entity_get_string(entEV_SZ_modelmodel31)
    
    
    
    if(
equali(model,"models/OGDaysMenu/w_dodgeball.mdl")) 
        
    {
        
        return 
PLUGIN_CONTINUE
        
    
}
    
    
// stop grenade from blowing up
    
    
return PLUGIN_HANDLED



ConnorMcLeod 08-18-2012 15:48

Re: W_Model does not display
 
Show the whole code, seems that you make something wrong at another place, also i don't think you need to hook "grenade" Think function, because your code prevent any kind of nade from blowing.

MokeN 08-18-2012 16:36

Re: W_Model does not display
 
Quote:

Originally Posted by retoxx (Post 1775408)
I can hold a dodgeball and see other players have the dodgball but when we throw the dodgeball it becomes a hegrenade in air and then just lay on the ground.

I have tried Everything to make the w_hegrenade turn into a w_dodgeball but it just dosn't work.

PHP Code:

public think_grenade(ent

{
    
    new 
model[32];
    
    
entity_get_string(entEV_SZ_modelmodel31)
    
    
    
    if(
equali(model,"models/OGDaysMenu/w_dodgeball.mdl")) 
        
    {
        
        return 
PLUGIN_CONTINUE
        
    
}
    
    
// stop grenade from blowing up
    
    
return PLUGIN_HANDLED



I know you're making a game menu, i used this:

These "GAME_DODGEBALL" are builded up in an enum, only if you want to have more than one game in ur game menu ;)

PHP Code:

public Ham_Touch_Grenade_PreiEntityid )
{
          if( 
GAME_DODGEBALL )
{
          static 
i_owner
          i_owner 
pev(iEntitypev_owner)
          if(
is_user_alive(id) && cs_get_user_team(i_owner) == CS_TEAM_T && cs_get_user_team(id) == CS_TEAM_T/*<-- T vs T*/
          
{
          
ExecuteHamB(Ham_Killedidi_owner0)
          }
          else 
remove_entity(iEntity/*<-- Removes the dodgeball*/
}


And about the w_ model:

(You need to edit it a little depending on how you did setting up your code..)

PHP Code:

public fwdSetModel(ent,const model[])
{    
    if(
g_iCurrentGame == GAME_NONE || !pev_valid(ent) || !equal(model,"models/w_hegrenade.mdl")) 
        return 
FMRES_IGNORED
        
    
switch(g_iCurrentGame)
    {
        case 
GAME_DODGEengfunc(EngFunc_SetModelentg_szBall_w)
    }
    
    return 
FMRES_SUPERCEDE



ConnorMcLeod 08-18-2012 16:39

Re: W_Model does not display
 
Don't use CurWeapon event to set p_ and v_ models, set them in Deploy post forward.

MokeN 08-18-2012 16:46

Re: W_Model does not display
 
Is it bad?

Tell me why..

meTaLiCroSS 08-18-2012 17:46

Re: W_Model does not display
 
Quote:

Originally Posted by MokeN (Post 1775521)
Is it bad?

Tell me why..

Deploy it's the unique function in that weapon models values are modified, so you would not need any other hook for overriding current weapon models. Also, CurWeapon it's called on every fire event, and it's not needed because the model, as I said, it's changed only when deploying a weapon.

MokeN 08-19-2012 14:33

Re: W_Model does not display
 
Ah, okay. Well then ;)


All times are GMT -4. The time now is 05:53.

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