UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: Pieternba2k on July 10, 2017, 08:25:16 am

Title: Perk powerup script
Post by: Pieternba2k on July 10, 2017, 08:25:16 am
Hello everyone I used this tutorial for my map:
https://ugx-mods.com/forum/index.php?topic=5796.0
and it works great, however I want to make it so when a person grabs the powerup everybody gets the perk instead of only the person who grabs it.
Does anybody know what I need to add to the script, it should be a simple tweak.

I believe this should be the part that needs to be modified:
getRandomPerk(player)
{
   //DUKIP - Make sure we're not drinking anything already.
   if(IsSubStr(player getCurrentWeapon(), "bottle") || (IsDefined(player.is_drinking) && player.is_drinking))
      return;

   all_perks = [];
   all_perks[0] = "specialty_armorvest";
   all_perks[1] = "specialty_quickrevive";
   all_perks[2] = "specialty_fastreload";
   all_perks[3] = "specialty_rof";
   //all_perks[NUM] = "specialty_XXXX";

   all_perks = array_randomize(all_perks);

   thePerk = random(all_perks);

   return thePerk;
}

Thanks a lot for your help!
Title: Re: Perk powerup script
Post by: codmoddd1234 on July 10, 2017, 10:57:48 am
I cant test till later but in the powerup_grab() function you should be able to change
players thread zombie_perk_powerup();
//To
allplayers=get_players();
array_thread(allplayers,::zombie_perk_powerup);
Title: Re: Perk powerup script
Post by: Pieternba2k on July 18, 2017, 08:51:47 pm
I cant test till later but in the powerup_grab() function you should be able to change
players thread zombie_perk_powerup();
//To
allplayers=get_players();
array_thread(allplayers,::zombie_perk_powerup);

thankyou