Raised This Month: $ Target: $400
 0% 

How to show weapon muzzleflash


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bos93
Veteran Member
Join Date: Jul 2010
Old 04-27-2013 , 07:54   Re: How to show weapon muzzleflash
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN_NAME                    "New MuzzleFlash"
#define PLUGIN_VERSION                "Alpha"
#define PLUGIN_AUTHOR                "WPMG Team"

// Работа с битами
#define get_bit(%1,%2)        (%1 & (1 << (%2 & 31)))
#define set_bit(%1,%2)        %1 |= (1 << (%2 & 31))
#define reset_bit(%1,%2)    %1 &= ~(1 << (%2 & 31))

new g_bitsMuzzleFlash;

new 
g_iEntity;

public 
plugin_precache()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    
    
precache_model("sprites/muzzleflash8.spr");
    
    
g_iEntity create_entity("info_target");
    
    
entity_set_model(g_iEntity"sprites/muzzleflash8.spr");
    
    
entity_set_float(g_iEntityEV_FL_scale0.2);
    
    
//entity_set_vector(g_iEntity, EV_VEC_angles, Float:{0.0, 0.0, 90.0});
    
    
entity_set_int(g_iEntityEV_INT_rendermodekRenderTransTexture);
    
entity_set_float(g_iEntityEV_FL_renderamt0.0);
}

public 
plugin_init()
{
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_m249""CM249__PrimaryAttack_Post"1);
    
    
register_forward(FM_AddToFullPack"CPlayer__AddToFullPack_post"1);
    
    
register_forward(FM_CheckVisibility"CEntity__CheckVisibility");
}

public 
CEntity__CheckVisibility(iEntitypSet)
{
    if (
iEntity != g_iEntity)
        return 
FMRES_IGNORED;
    
    
forward_return(FMV_CELL1);
    
    return 
FMRES_SUPERCEDE;
}

public 
CM249__PrimaryAttack_Post(iEntity)
{
    new 
iPlayerID get_pdata_cbase(iEntity414);
    
    
set_bit(g_bitsMuzzleFlashiPlayerID);
}

public 
CPlayer__AddToFullPack_post(esStateiEiEntiHostiHostFlagsiPlayerpSet)
{
    if (
iEnt != g_iEntity)
        return;
    
    if (
get_bit(g_bitsMuzzleFlashiHost))
    {
        
set_es(esStateES_Framefloat(random_num(02)));
            
        
set_es(esStateES_RenderModekRenderTransAdd);
        
set_es(esStateES_RenderAmt255.0);
        
        
reset_bit(g_bitsMuzzleFlashiHost);
    }
        
    
set_es(esStateES_SkiniHost);
    
set_es(esStateES_Body1);
    
set_es(esStateES_AimEntiHost);
    
set_es(esStateES_MoveTypeMOVETYPE_FOLLOW);

__________________

Last edited by Bos93; 04-27-2013 at 18:20.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
 



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 10:58.


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