Thread Rating:
  • 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 2,159 10-31-2013, 23:03
Last Post: Nekochan
Question Help Mw2 weapon skin question FroxIVx4 1 2,950 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 6,584 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 4,734 09-15-2013, 16:43
Last Post: DidUknowiPwn
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,267 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,737 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Mw2 weapon skin question FroxIVx4 1 2,920 07-06-2013, 19:22
Last Post: surtek
  [Request] List of all weapon models DidUknowiPwn 3 4,628 04-20-2013, 09:13
Last Post: Dominator56
  [Release] !weapon Plugin 8q4s8 40 25,624 03-24-2013, 17:02
Last Post: X-Track
  [Release] Black Ops ZM & MP weapon ID's JariZ 7 30,978 03-01-2013, 22:04
Last Post: JariZ

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.