View Single Post
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 01-23-2012 , 06:52   Re: Half-Life UT Style Weapons Floating
Reply With Quote #27

Quote:
Originally Posted by BodyBuilder View Post
http://www.youtube.com/watch?v=IJ3whCyWcZ0

Update: hope to enjoy



weapons_spin_on_off "1"
weapons_spin_speed "35.0"
weapons_effects_on_off "1"

//mode 1: Hologram.
//mode 2: Explode models will be big.
//mode 3: Glow Shell random rgb colors.
//mode 4: Glow Shell manual color with "weapons_glows_color" cvar.
//mode 5: Glow Shell transparent

weapons_effects_mode "3"
weapons_glows_color "255 255 255"
weapons_glows_thickness "255"



PHP Code:
#include amxmodx
#include engine
#include hamsandwich
#include fakemeta_util

#define PLUGIN "HL Weapons Floating; Updated By: BodyBuilder"
#define VERSION "2.0"
#define AUTHOR "tuty"


new const HalfLifeWeaponsEntities[][] = 
{
    
"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 const 
hldmitems[][] = 

"item_battery"
"item_healthkit"
"item_longjump",
"item_suit" 
}

new
weapons_spin_on_off,
weapons_spin_speed,
weapons_effects_on_off,
weapons_effects_mode,
weapons_glows_color,
weapons_glows_thickness

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    for(new 
0sizeof(HalfLifeWeaponsEntities); i++)
{
    
register_touch(HalfLifeWeaponsEntities[i],"worldspawn","WeaponsTouchTheGround")
}
    
set_task(0.25,"Item_Task")

    
weapons_spin_on_off register_cvar("weapons_spin_on_off","1")
    
weapons_spin_speed register_cvar("weapons_spin_speed","35.0")
    
weapons_effects_on_off register_cvar("weapons_effects_on_off","1")
    
weapons_effects_mode register_cvar("weapons_effects_mode","3")
    
weapons_glows_color register_cvar("weapons_glows_color","255 255 255")
    
weapons_glows_thickness register_cvar("weapons_glows_thickness","255")
}

public 
Item_Task(ent)
{
    for(new 
0sizeof(hldmitems); i++)
    while((
ent find_ent_by_class(ent,hldmitems[i])) > 0)
{
    
WeaponsSpinAndEffects(ent)
}
    return 
PLUGIN_CONTINUE
}

public 
WeaponsTouchTheGround(ent)
{
    if(
is_valid_ent(ent))
{
    
WeaponsSpinAndEffects(ent)
}
    return 
PLUGIN_CONTINUE
}

public 
WeaponsSpinAndEffects(ent)
{
    new 
Float:WeaponOrigin[3]

    
entity_get_vector(ent,EV_VEC_origin,WeaponOrigin)
        
    
WeaponOrigin[2] += 30.0
        
    entity_set_origin
(ent,WeaponOrigin)

    
entity_set_int(ent,EV_INT_movetype,MOVETYPE_NOCLIP)
        
    
set_task(0.25,"WeaponSpinGoGo",ent)
    
    static 
redgreenblue,
    
rgbthickness

    r 
random(255)
    
random(0)
    
random(0)

    
get_glow_color(red,green,blue)

    
thickness get_pcvar_num(weapons_glows_thickness)
    
    if(
get_pcvar_num(weapons_effects_on_off))
{
    switch(
get_pcvar_num(weapons_effects_mode))
{
    case 
1:
{
    
fm_set_rendering(ent,kRenderFxHologram,0,0,0,kRenderTransAdd)
}
    case 
2:
{
    
fm_set_rendering(ent,kRenderFxExplode,0,0,0,kRenderNormal)
}
    case 
3:
{
    
fm_set_rendering(ent,kRenderFxGlowShell,r,g,b,kRenderNormal,thickness)
}
    case 
4:
{
    
fm_set_rendering(ent,kRenderFxGlowShell,red,green,blue,kRenderNormal,thickness)
}
    case 
5:
{
    
fm_set_rendering(ent,kRenderFxGlowShell,red,green,green,kRenderTransColor,1)
}
}
}
    return 
PLUGIN_CONTINUE
}

public 
get_glow_color(&r, &g, &b
{
    static 
color[20], red[5], green[5], blue[5]
    
get_pcvar_string(weapons_glows_color,color,charsmax(color))
    
parse(color,red,charsmax(red),green,charsmax(green),blue,charsmax(blue))
    
str_to_num(red)
    
str_to_num(green)
    
str_to_num(blue)
    return 
PLUGIN_CONTINUE
}

public 
WeaponSpinGoGo(ent)
{
    if(
get_pcvar_num(weapons_spin_on_off) && is_valid_ent(ent))
{
    new 
Float:Avelocity[3]
    
    
Avelocity[0] = get_pcvar_float(weapons_spin_speed)
    
Avelocity[1] = get_pcvar_float(weapons_spin_speed)
    
Avelocity[2] = get_pcvar_float(weapons_spin_speed)
        
    
entity_set_vector(ent,EV_VEC_avelocity,Avelocity)
}
    return 
PLUGIN_CONTINUE

did you had my permission tu update it and put it in my original thread?
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty