Post: self GiveWeapon() Issues
03-22-2016, 05:57 PM #1
DH63
Retired Staff
(adsbygoogle = window.adsbygoogle || []).push({}); I can get my code to work good as in it gives me the weapon that I desire, but it doesn't work the way I want it to.

Other menus, when giving yourself a ray gun in zombies, the weapon plays the actual sound as if you got it from the mystery box and mine is silent during the pickup animation.

Also, if I buy a gun from the wall then use the code to get a ray gun it replaces my secondary with a pistol...Can someone help me with this?

    
GiveRayGun()
{
self.currentWeapon = "ray_gun_upgraded_zm";
self takeWeapon(self getCurrentWeapon());
self GiveWeapon("ray_gun_upgraded_zm");
self SwitchToWeapon(self.currentWeapon);
self iprintln("Ray Gun ^2Given");
}
(adsbygoogle = window.adsbygoogle || []).push({});
03-22-2016, 07:15 PM #2
Loz
Vault dweller
Originally posted by dahacka666 View Post
snip


self playSound("zmb_cha_ching");
03-22-2016, 07:25 PM #3
DH63
Retired Staff
Originally posted by Loz View Post
self playSound("zmb_cha_ching");


Thanks! Can you also help me with my No Clip code? It doesn't disable when I press R3 and I am stuck floating in the air.

    
NoclipToggle()
{
self endon("stop_noclip");
self.originObj = spawn( "script_origin", self.origin, 1 );
self.originObj.angles = self.angles;
self playerlinkto( self.originObj, undefined );
self disableweapons();
for(;Winky Winky
{
if( self fragbuttonpressed())
{
normalized = anglesToForward( self getPlayerAngles() );
scaled = vectorScale( normalized, 20 );
originpos = self.origin + scaled;
self.originObj.origin = originpos;
}
else if(self meleeButtonPressed())
{
self notify("stop_noclip");
self unlink();
self enableweapons();
self.originObj delete();
}
wait .05;
}
}
03-22-2016, 07:31 PM #4
Loz
Vault dweller
Originally posted by dahacka666 View Post
Thanks! Can you also help me with my No Clip code? It doesn't disable when I press R3 and I am stuck floating in the air.

    
NoclipToggle()
{
self endon("stop_noclip");
self.originObj = spawn( "script_origin", self.origin, 1 );
self.originObj.angles = self.angles;
self playerlinkto( self.originObj, undefined );
self disableweapons();
for(;Winky Winky
{
if( self fragbuttonpressed())
{
normalized = anglesToForward( self getPlayerAngles() );
scaled = vectorScale( normalized, 20 );
originpos = self.origin + scaled;
self.originObj.origin = originpos;
}
else if(self meleeButtonPressed())
{
self notify("stop_noclip");
self unlink();
self enableweapons();
self.originObj delete();
}
wait .05;
}
}


get rid of "else" in the second if statment
03-24-2016, 04:57 PM #5
BullyWiiPlaza
Climbing up the ladder
This is for giving a weapon with the cha ching sound:
    buyWeapon(weapon)
{
self maps/mp/zombies/_zm_weapons::weapon_give(weapon);
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo