02-16-2011, 12:38
So i'm trying to add some fx to the weapon spots
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..
btw thanx to alistair for posting this stuff
PHP Code:
CreateWeapon(weapon, name, pos, angle, stock, respawntime)
{
weapon_model = getWeaponModel(weapon);
if(weapon_model == ""){
weapon_model = weapon;
}
Wep = spawn("script_model", pos+(0,0,3), 1);
Wep.angles = angle;
Wep SetOwner( level );
Wep setModel(weapon_model);
Wep thread WeaponThink(weapon, name, pos, angle, stock, respawntime);
wait 0.01;
}
WeaponThink(weapon, name, pos, angle, stock, respawntime)
{
area = spawn("trigger_radius", self.origin, 0, 25, 50);
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 giveWeapon( weapon );
player setWeaponAmmoClip( weapon, 2 );
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(weapon, name, pos, angle, stock, respawntime);
}
area delete();
self delete();
return;
}
}
wait .04;
}
}
WeaponRespawnThink(weapon, name, pos, angle, stock, respawntime)
{
wait respawntime;
CreateWeapon(weapon, name, pos, angle, stock, respawntime);
}
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..
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