Raised This Month: $51 Target: $400
 12% 

Half-Life UT Style Weapons Floating


Post New Thread Reply   
 
Thread Tools Display Modes
Murz
Member
Join Date: Jan 2015
Location: Lithuania Vilnius
Old 01-26-2017 , 22:00   Re: Half-Life UT Style Weapons Floating
Reply With Quote #31

L 01/27/2017 - 00:007: [AMXX] Displaying debug trace (plugin "HL_WeaponFloating.amxx", version "2.0.0")
L 01/27/2017 - 00:007: [AMXX] Run time error 10: native error (native "get_pcvar_num")
L 01/27/2017 - 00:007: [AMXX] [0] HL_WeaponFloating.sma::WeaponsTouchTheGround (line 57)
Murz is offline
Send a message via Skype™ to Murz
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-27-2017 , 07:36   Re: Half-Life UT Style Weapons Floating
Reply With Quote #32

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

#pragma semicolon 1

new const gHalfLifeItemNames[ ][ ] =
{
    
"item_battery"
    
"item_healthkit"
    
"item_longjump"
    
"item_suit"
};

new const 
gHalfLifeWeaponEntitiesNames[ ][ ] = 
{
    
"ammo_357""ammo_9mmAR""ammo_9mmbox""ammo_9mmclip""ammo_ARgrenades",
    
"ammo_buckshot""ammo_crossbow""ammo_egonclip""ammo_gaussclip""ammo_glockclip",
    
"ammo_mp5clip""ammo_mp5grenades""ammo_rpgclip""weaponbox""weapon_357"
    
"weapon_9mmAR""weapon_9mmhandgun""weapon_crossbow""weapon_egon""weapon_gauss",
    
"weapon_glock""weapon_handgrenade""weapon_hornetgun""weapon_mp5""weapon_python",
    
"weapon_rpg""weapon_satchel""weapon_shotgun""weapon_snark""weapon_tripmine"
};

new 
gFloatingWeaponsEnabled;
new 
gFloatingWeaponsGlow;
new 
gFloatingWeaponsSpeed;
new 
gFloatingWeaponsGlowThickness;

public 
plugin_init( )
{
    
register_plugin"HL Weapons Floating""2.0.0""tuty" );

    new 
i;

    for( 
0sizeofgHalfLifeWeaponEntitiesNames ); i++ )
    {
        
register_touchgHalfLifeWeaponEntitiesNames], "worldspawn""WeaponsTouchTheGround" );
        
register_touchgHalfLifeWeaponEntitiesNames], "func_wall""WeaponsTouchTheGround" );
    }

    for( 
0sizeofgHalfLifeItemNames ); i++ )
    {
        
RegisterHamHam_RespawngHalfLifeItemNames], "bacon_ItemsRespawned" );
    }

    
gFloatingWeaponsEnabled register_cvar"hl_fw_enabled""1" );
    
gFloatingWeaponsGlow register_cvar"hl_fw_glow""1" );
    
gFloatingWeaponsSpeed register_cvar"hl_fw_speed""25.0" );
    
gFloatingWeaponsGlowThickness register_cvar"hl_fw_glow_thickness""10.0" );
}

public 
WeaponsTouchTheGroundiEntityiWorldspawn )
{
    if( 
get_pcvar_numgFloatingWeaponsEnabled ) == && is_valid_ent(iEntity) ) 
        
FloatAndSpinWeaponsiEntity );
}

public 
bacon_ItemsRespawnediEntity )
{
    if( 
get_pcvar_numgFloatingWeaponsEnabled ) != )
    {
        
entity_set_intiEntityEV_INT_movetypeMOVETYPE_TOSS );
        
drop_to_flooriEntity );
        
        
FloatAndSpinWeaponsiEntity );
    }
}

public 
FloatAndSpinWeaponsiEntity )
{
    new 
Float:flWeaponOrigin];
    
entity_get_vectoriEntityEV_VEC_originflWeaponOrigin );
        
    
flWeaponOrigin] += 30.0;
    
entity_set_originiEntityflWeaponOrigin );

    new 
Float:flAngles];
    
entity_get_vectoriEntityEV_VEC_anglesflAngles );
    
    
flAngles] -= floatrandom80 ) );
    
flAngles] += floatrandom50 ) );
    
    
entity_set_vectoriEntityEV_VEC_anglesflAngles );
    
entity_set_intiEntityEV_INT_movetypeMOVETYPE_NOCLIP );

    
set_task0.9"WeaponSpinGoGo"iEntity );
        
    if( 
get_pcvar_numgFloatingWeaponsGlow ) == )
    {
        new 
Float:flRenderColor];
            
        
flRenderColor] = random_float0.0255.0 );
        
flRenderColor] = random_float0.0255.0 );
        
flRenderColor] = random_float0.0255.0 );

        
entity_set_intiEntityEV_INT_renderfxkRenderFxGlowShell );
        
entity_set_vectoriEntityEV_VEC_rendercolorflRenderColor );
        
entity_set_floatiEntityEV_FL_renderamtget_pcvar_floatgFloatingWeaponsGlowThickness ) );
    }
}

public 
WeaponSpinGoGoiEntity )
{
    if( 
is_valid_entiEntity ) )
    {
        new 
Float:flAvelocity];
        
        
flAvelocity] = 0.0;
        
flAvelocity] = get_pcvar_floatgFloatingWeaponsSpeed );
        
flAvelocity] = 0.0;
        
        
entity_set_vectoriEntityEV_VEC_avelocityflAvelocity );
    }

__________________
edon1337 is offline
Reply



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 03:51.


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