UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: Rorke on March 22, 2015, 02:20:55 pm

Title: wonderwaff script!!!!
Post by: Rorke on March 22, 2015, 02:20:55 pm
Code Snippet
Plaintext
add_limited_tesla_gun()
{

weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );

for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = weapon_spawns[i].zombie_weapon_upgrade;
if(hint_string == "tesla_gun")
{
weapon_spawns[i] waittill("trigger");
weapon_spawns[i] trigger_off();
break;

}

}

}

what exactly does this code do?
Title: Re: wonderwaff script!!!!
Post by: daedra descent on March 22, 2015, 02:25:21 pm
Buyable tesla gun that you can only buy once from the looks of it.
Title: Re: wonderwaff script!!!!
Post by: liamsa669 on March 22, 2015, 02:26:33 pm
Code Snippet
Plaintext
add_limited_tesla_gun()
{

weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" ); // gets all entities with the targetname of "weapon_upgrade"

for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = weapon_spawns[i].zombie_weapon_upgrade; // gathers the kvp "zombie_weapon_upgrade"
if(hint_string == "tesla_gun") // checks if thats the wonderwaffle
{
weapon_spawns[i] waittill("trigger"); // waits till the trigger is hit
weapon_spawns[i] trigger_off(); // turns off the trigger
break; // stops the for loop

}

}

}
thats what
Title: Re: wonderwaff script!!!!
Post by: Rorke on March 22, 2015, 02:27:52 pm
yeah but thers no cost in this script!!!! (like Cost: 1200 or something)
Title: Re: wonderwaff script!!!!
Post by: HitmanVere on March 22, 2015, 02:28:53 pm
DD is right in some part. It limits, so other players cant get Wunderwaffe, only one person can have it at time (havent tested with box with this code on) Well, I had this problem and I asked it in here and removing that made Wunderwaffe buyable again

For cost, its set in triggers KVPs
Title: Re: wonderwaff script!!!!
Post by: Rorke on March 22, 2015, 02:30:54 pm
so if i was to remove this wonder weap would i be able to remove this peice of code without error's?
Title: Re: wonderwaff script!!!!
Post by: IHammY/ on March 22, 2015, 02:31:26 pm
i get the wonder part but what is a waff?!  :o
Title: Re: wonderwaff script!!!!
Post by: Rorke on March 22, 2015, 02:33:01 pm
i get the wonder part but what is a waff?!  :o
is "tesla gun" better for you? sorry im not the best person in the world when it comes to spelling. so excuse me.....anyway +1 to hitmanvere and DD
Title: Re: wonderwaff script!!!!
Post by: Harry Bo21 on March 23, 2015, 08:43:26 am
even if you dont remove the weapon itself, you could remove this code, assuming its not being referenced anywhere else