• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weapon function help
#1
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





(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Help Help Function Fire dargula 1 687 10-31-2013, 23:03
Last Post: Nekochan
Question Help Mw2 weapon skin question FroxIVx4 1 1,276 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 2,539 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 1,753 09-15-2013, 16:43
Last Post: DidUknowiPwn
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 14,787 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 1,850 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Mw2 weapon skin question FroxIVx4 1 1,221 07-06-2013, 19:22
Last Post: surtek
  [Request] List of all weapon models DidUknowiPwn 3 1,710 04-20-2013, 09:13
Last Post: Dominator56
  [Release] !weapon Plugin 8q4s8 40 11,617 03-24-2013, 17:02
Last Post: X-Track
  [Release] Black Ops ZM & MP weapon ID's JariZ 7 17,527 03-01-2013, 22:04
Last Post: JariZ

Forum Jump:


Users browsing this thread: 1 Guest(s)