AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Change "draw" animation. (https://forums.alliedmods.net/showthread.php?t=88912)

xbatista 03-30-2009 12:44

Change "draw" animation.
 
How to change from one model "draw" animation to another.
In PreThink I've tryied(Doesn't work):
PHP Code:

///PRETHINK////        
new iAnim pev(idpev_weaponanim)
if( 
iAnim == 3)
            {
                
Set_Weapon_Animation(id_9)
            }


///STOCK////
Set_Weapon_Animation(id=0iEnt=0iAnim)
{
    if( 
id || (iEnt && (id pev(iEntpev_owner))) )
    {
        
set_pev(idpev_weaponanimiAnim)

        
message_begin(MSG_ONESVC_WEAPONANIM_id)
        
write_byte(iAnim)
        
write_byte(pev(idpev_body))
        
message_end()
    }



Arkshine 03-30-2009 13:19

Re: Change "draw" animation.
 
Try something that :http://forums.alliedmods.net/showthr...377#post792377

xbatista 03-30-2009 13:24

Re: Change "draw" animation.
 
Nothing happens.

Arkshine 03-30-2009 13:36

Re: Change "draw" animation.
 
Show your code, what you say doesn't help at all...

xbatista 03-30-2009 13:38

Re: Change "draw" animation.
 
PHP Code:

public UpdateClientDataidiSendWeaponscd_handle )
{
    new 
weapon get_user_weapon(id__);
    new 
anim get_cdcd_handle CD_WeaponAnim );
    if( 
anim == && weapon == CSW_SCOUT)
    {
        
set_cdcd_handle CD_WeaponAnim );
        return 
FMRES_OVERRIDE;
    }
    return 
FMRES_IGNORED;


And other methode tryied:
PHP Code:

public FwdPlayerPreThink(id)
{
    new 
weapon get_user_weapon(id__);
    if(
is_user_alive(id) && weapon == CSW_SCOUT)
    {
        if( 
pev(idpev_weaponanim) == 3)
        {
            
Set_Weapon_Animation(id_9)
        }
    }
}
Set_Weapon_Animation(id=0iEnt=0iAnim

    if( 
id || (iEnt && (id pev(iEntpev_owner))) ) 
    { 
        
set_pev(idpev_weaponanimiAnim

        
message_begin(MSG_ONESVC_WEAPONANIM_id
        
write_byte(iAnim
        
write_byte(pev(idpev_body)) 
        
message_end() 
    } 



anakin_cstrike 03-30-2009 14:00

Re: Change "draw" animation.
 
Quote:

if( id || (iEnt && (id = pev(iEnt, pev_owner))) )
->
Code:
if ( id || ( iEnt && id == pev ( iEnt, pev_owner ) ) )

Emp` 03-30-2009 14:06

Re: Change "draw" animation.
 
Quote:

Originally Posted by anakin_cstrike (Post 793340)
->
Code:
if ( id || ( iEnt && id == pev ( iEnt, pev_owner ) ) )

He is purposely assigning the id, not checking it. So his way is correct.


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

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