ItsMods

Full Version: Weapon function help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So i'm trying to add some fx to the weapon spots

PHP Code:
CreateWeapon(weaponnameposanglestockrespawntime)
{
        
weapon_model getWeaponModel(weapon);
        if(
weapon_model == ""){
                
weapon_model weapon;
        }
        
Wep spawn("script_model"pos+(0,0,3), 1);
        
Wep.angles angle;
        
Wep SetOwnerlevel );
        
Wep setModel(weapon_model);
        
Wep thread WeaponThink(weaponnameposanglestockrespawntime);
        
wait 0.01;
}

WeaponThink(weaponnameposanglestockrespawntime)
{
        
area spawn("trigger_radius"self.origin02550);
        while(
1)
        {
                
area waittill("trigger"player);
                
player.hint "Press ^3[{+activate}] ^7to pick up " name;
                if(
player UseButtonPressed()){
                        switch( 
weapon )
                        {
                        case 
"frag_grenade_mp":
                        case 
"sticky_grenade_mp":
                        case 
"hatchet_mp":
                        case 
"flash_grenade_mp":
                        case 
"concussion_grenade_mp":
                        case 
"tabun_gas_mp":
                        case 
"nightingale_mp":
                        case 
"willy_pete_mp":
                                
player takeWeapon(player getCurrentOffhand());
                                
player giveWeaponweapon );
                                
player setWeaponAmmoClipweapon);
                                break;

                        default:
                                
player giveWeapon(weapon);
                                
player GiveMaxAmmo(weapon);
                                
player.weaponlist player GetWeaponsListPrimaries();
                                if(
player.weaponList.size level.maxweaponper){
                                        
player takeWeapon(player getCurrentWeapon());
                                }
                                
player SwitchToWeapon(weapon);
                                break;
                        }
                        if(
stock 1){
                                
stock--;
                        } else {
                                if(
isDefined(respawntime)){
                                        
level thread WeaponRespawnThink(weaponnameposanglestockrespawntime);
                                }
                                
area delete();
                                
self delete();
                                return;
                        }
                }
                
wait .04;
        }
}

WeaponRespawnThink(weaponnameposanglestockrespawntime)
{
        
wait respawntime;
        
CreateWeapon(weaponnameposanglestockrespawntime);

this is killingdyl's weapon building function but here is what i want:

the weapons spawns @ start of match (no prob), i want it to float 1 meter above the ground with this: "misc/fx_equip_tac_insert_light_grn" fx on the same coordinates as the gun so it gets a green glow around it.. does anyone know how to put the fx on the map?

then if the gun gets picked up the gun disappears and the fx changes to this one: "misc/fx_equip_tac_insert_light_red" after 20 seconds the gun respawns and the the green glow returns.

i'm pretty sure its possible to edit the building function to do what i want it to do but i have no idea how to put the fx in there..

Big Grin btw thanx to alistair for posting this stuff