AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to shop v_ model body index ? (https://forums.alliedmods.net/showthread.php?t=213347)

gubka 04-13-2013 16:27

How to shop v_ model body index ?
 
I think about change submodels if you have admin flag (how in cso-nst)
I try it on glock18 on the reload anim
I make it , and all work (if i play player and reload i see first submodel and if i admin i saw second submodel? but for exhample , every 10 times i with admin flag didn't saw second submodel.
Who will may fix it.
It's my code
PHP Code:

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

#define VIP ADMIN_LEVEL_H

new V_MODEL[64] = "models/v_glock188.mdl"

public plugin_init() 
{
    
register_plugin("test""0.1""qubka")
    
    
RegisterHam(Ham_CS_Weapon_SendWeaponAnim"weapon_glock18""Reload_Anim")
    
register_event("CurWeapon","CurrentWeapon","be","1=1")
    
register_forward(FM_CmdStart"fw_CmdStart")
}
public 
plugin_precache()
{
    
precache_model(V_MODEL)
}

public 
CurrentWeapon(id)
{
    
replace_weapon_models(idread_data(2))
}
replace_weapon_models(idweaponid)
{
    new 
wpn get_user_weapon(id)

    if (
wpn == CSW_GLOCK18)
    {
        
set_pev(idpev_viewmodel2V_MODEL)
    
    }
}


public 
fw_CmdStart(iduc_handleseed
{
    
// Ignore dead
    
if (!is_user_alive(id))
        return 
FMRES_IGNORED
    
    
if((get_ucuc_handleUC_Buttons) & IN_RELOAD) && !(pev(id,pev_oldbuttons) & IN_RELOAD))
    {
        
Reload_Anim(id)

        return 
PLUGIN_HANDLED
    
}
    return 
FMRES_HANDLED
}


public 
Reload_Anim(id)
{
    if(
get_user_flags(id) & VIP)
    {
       
SendWeaponAnim(id7)
       return 
HAM_SUPERCEDE
    
}
    else if(!
get_user_flags(id) & VIP)
    {
       
SendWeaponAnim1(id7)
       return 
HAM_SUPERCEDE
    
}
    return 
HAM_SUPERCEDE
}

SendWeaponAnim(const Player, const Sequence


    
set_pev(Playerpev_weaponanimSequence

    
message_begin(MSG_ONESVC_WEAPONANIM, .player Player
    
write_byte(Sequence
    
write_byte(1
    
message_end() 

}  

SendWeaponAnim1(const Player, const Sequence


    
set_pev(Playerpev_weaponanimSequence

    
message_begin(MSG_ONESVC_WEAPONANIM, .player Player
    
write_byte(Sequence
    
write_byte(0
    
message_end() 





All times are GMT -4. The time now is 10:57.

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