AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapon animation is not displayed.. (https://forums.alliedmods.net/showthread.php?t=121312)

fezh 03-14-2010 10:01

Weapon animation is not displayed..
 
I made this plugin to try to "fix" what I stated in that thread. Actually that's not the point. When I change models whenever FOV is lower or equal than/to 40 (zooming with AWP & Scout) and I attack the weapon animation is not displayed at all. Any ideas why is it happening and how I can fix it?

PS: I already tried with something like this but it does not work either.

ConnorMcLeod 03-14-2010 14:26

Re: Weapon animation is not displayed..
 
Dunno about your problem, tested your plugin with no problem.

I would optimize it though, don't need to store the string, just store the string index instead.
Also, don't use switch if you have like 55 cases...

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

const iMaxSlots 32;
new 
g_iWeaponModeliMaxSlots+];

public 
plugin_init( )
{
    
register_plugin"Zoomed Models Fix""0.1.1""DruX" );
    
    
register_event"SetFOV" "Event_SetFOV" "be" );

    
// use new so the memory is free when you exit current function    
    
new szWeaponName20 ]; // weapon_smokegrenade = 19
    
    
for ( new CSW_P228<= CSW_P90i++ )
    {
        if( 
get_weaponnameiszWeaponNamecharsmaxszWeaponName ) ) )
        {
            
RegisterHamHam_Item_DeployszWeaponName"HamFwd_Item_Deploy_Post");
        }
    }
}

public 
Event_SetFOVid )
{
    if ( 
get_user_weaponid ) )
    {
        if( 
read_data(1) < 55 )
        {
            
set_pev(idpev_viewmodel0);
        }
        else if( !
pev(idpev_viewmodel) )
        {
            
set_pev(idpev_viewmodelg_iWeaponModel[id]);
        }
    }
}

public 
HamFwd_Item_Deploy_PostiEnt )
{
    const 
XTRA_OFS_WEAPON 4;
    const 
m_pPlayer 41;

    new 
id get_pdata_cbaseiEntm_pPlayerXTRA_OFS_WEAPON );
    
g_iWeaponModel[id] = pev(idpev_viewmodel);




All times are GMT -4. The time now is 08:42.

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