Raised This Month: $ Target: $400
 0% 

set weaponanim by entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Gian_Yagami
Member
Join Date: Apr 2014
Old 01-28-2016 , 10:24   Re: set weaponanim by entity
Reply With Quote #7

until now, I have changed the codes many times and decided not to use ham_item_holster and ham_item_deploy because is not called when player use quick change to last weapon used button. This is my current code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <engine>

#define PLUGIN "Weapon"
#define VERSION "1.0"
#define AUTHOR "Gian Yagami"

new ent_hWpn[18]
new 
ent_dWpn[18]
new 
playerid


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("CurWeapon""Event_Cur_Weapon",  "b")
    


stock UTIL_SenwWeaponAnim(const playerid, const Sequence)
{
    
set_pev(playeridpev_weaponanimSequence)

    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player playerid)
    
write_byte(Sequence)
    
write_byte(pev(playeridpev_body))
    
message_end()
}

public 
Event_Cur_Weapon(ent// Always looping whenever player grab a weapon
{
    
playerid pev(entpev_owner)

    if (!
pev(playeridpev_weaponanim8)) //Checking if animation is still play or not. idk this work or not
        
set_pev(playeridpev_weaponsent_dWpn)

    for (new 
0sizeof ent_hWpni++)
    {
        for (new 
0sizeof ent_dWpnj++)
        {
            if (
ent_hWpn[i] != ent_dWpn[j] )
            {
                
set_pev(playeridpev_weaponsent_hWpn// change weapon to previous idk this work or not
                
UTIL_SenwWeaponAnim(playerid8)
                
sizeof ent_hWpnsizeof ent_dWpn;
            }
        }
    }

I'm still wonder how to use pev_weapons and checking animation

Quote:
Originally Posted by Arkshine View Post
A right stock is something like that : https://forums.alliedmods.net/showpo...7&postcount=26
I see owner keyword and the value is zero, how I can input player index? because I want specific player meet the conditions. Who change the weapon.
Gian_Yagami is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:32.


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