Help Zombie Prizes
#1
Hello

I tried to make prizes for zombies(like BO: bomb, repair all windows, minigun...), but for the moment I only managed to make a deathstreak, could somebody help me on making it with random deaths???? Huh

This code works, is what I have:


Code:
Prize() { self waittill("death"); Prize = spawn("script_model", self.origin ); Prize setModel("scavenger_bag_mp"); trigger = spawn( "trigger_radius", self.origin, 0, 50, 50 ); trigger thread EarnPrizes(Prize, trigger); } EarnPrizes(Prize, trigger) { self endon("disconnect"); while(1) { self waittill( "trigger", player ); if(Distance(Prize, Player.origin) <= 50 && player.pers["team"] == game["attackers"] ) { player thread Prizes(); wait 3; Prize delete(); trigger delete(); wait 1; } } } Prizes() { switch(RandomInt(4)) { case 0: self maps\mp\killstreaks\_airdrop::refillAmmo(); self playLocalSound( "ammo_crate_use" ); break; case 1: self _setperk("specialty_coldblooded"); break; case 2: self GiveWeapon("onemanarmy_mp", 0, false); break; case 3: self GiveWeapon("deserteaglegold_mp", 0, true); break; } }
Reply

#2
Many people do it so un-organized. Controll your } and )'s
I organized your code a litle, and put some } and )'s where was needed, about the code: I don't know if some things are right. Let some check it for you.

Code:
Prize() { self waittill("death"); Prize = spawn("script_model", self.origin ); Prize setModel("scavenger_bag_mp"); trigger = spawn( "trigger_radius", self.origin, 0, 50, 50 ); trigger thread EarnPrizes(Prize, trigger); } EarnPrizes(Prize, trigger) { self endon("disconnect"); while(1) { self waittill( "trigger", player ); if(Distance((Prize, Player.origin) <= 50 && player.pers["team"] == game["attackers"]) { player thread Prizes(); wait 3; Prize delete(); trigger delete(); wait 1; } } } Prizes() { switch(RandomInt(4)) { case 0: self maps\mp\killstreaks\_airdrop::refillAmmo(); self playLocalSound( "ammo_crate_use" ); break; case 1: self _setperk("specialty_coldblooded"); break; case 2: self GiveWeapon("onemanarmy_mp", 0, false); break; case 3: self GiveWeapon("deserteaglegold_mp", 0, true); break; } }
Reply

#3
(03-25-2011, 20:24)surtek Wrote: Many people do it so un-organized. Controll your } and )'s
Also edited your code a litle:

Code:
Prize() { self waittill("death"); Prize = spawn("script_model", self.origin ); Prize setModel("scavenger_bag_mp"); trigger = spawn( "trigger_radius", self.origin, 0, 50, 50 ); trigger thread EarnPrizes(Prize, trigger); } EarnPrizes(Prize, trigger) { self endon("disconnect"); while(1) { self waittill( "trigger", player ); if(Distance(Prize, Player.origin) <= 50 && player.pers["team"] == game["attackers"] ) { player thread Prizes(); wait 3; Prize delete(); trigger delete(); wait 1; } } } Prizes() { switch(RandomInt(4)) { case 0: self maps\mp\killstreaks\_airdrop::refillAmmo(); self playLocalSound( "ammo_crate_use" ); break; case 1: self _setperk("specialty_coldblooded"); break; case 2: self GiveWeapon("onemanarmy_mp", 0, false); break; case 3: self GiveWeapon("deserteaglegold_mp", 0, true); break; } }

O.o, in my _rank.gsc is all organized, with easy to read spaces, I dont know why it changed, Undecided, have idea of how to make this???
Reply

#4
Maybe try to use 2 different functions to place the trigger and the script model?
(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

#5
(03-25-2011, 22:24)iAegle Wrote: Maybe try to use 2 different functions to place the trigger and the script model?

and that for???? Huh

I want to make prizes like BO with random deaths, the code I posted works, but it gives the prize after 1 death, I can increase the number of deaths necesary just by adding more level waittill ( "death"), but I want to make that the number of deaths is random and not a normal deathstreak.
Reply

#6
(03-26-2011, 08:15)Yamato Wrote:
(03-25-2011, 22:24)iAegle Wrote: Maybe try to use 2 different functions to place the trigger and the script model?

and that for???? Huh

I want to make prizes like BO with random deaths, the code I posted works, but it gives the prize after 1 death, I can increase the number of deaths necesary just by adding more level waittill ( "death"), but I want to make that the number of deaths is random and not a normal deathstreak.

You can close, I found a way, was very easy. Smile
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  BF4 zombie 'mod' JariZ 4 11,597 08-17-2014, 14:23
Last Post: Yamato
  [Request] Modder/s for R2K Zombie MOD mr.apple 4 6,801 10-25-2013, 12:45
Last Post: mr.apple
Tongue Zombie CE Table xtreme2010 5 7,961 08-01-2013, 18:15
Last Post: barata
  Zombie model imchasinyou 7 9,862 07-31-2013, 01:11
Last Post: rotceh_dnih
Star [Release] 8 new Zombie maps for ItsZombieMod mahafy00 31 39,846 07-20-2013, 07:28
Last Post: benm4a
  Help Modding Zombie Mode DarthKiller 3 6,682 07-09-2013, 21:08
Last Post: Nekochan
Information Preview 'KillMe' zombie mod Nekochan 115 77,015 07-03-2013, 14:56
Last Post: X-Track
  [Release] Black Ops Single Player/Zombie Trainer V3.6 Craig87 52 101,665 07-01-2013, 15:12
Last Post: explosivebanana55
  [Release] MW3 Mod: Zombie Juggernauts NChecker 8 20,495 06-27-2013, 05:38
Last Post: xX_ANTZ_Xx
Video Preview AIZombies eXtreme 2.0 / Zombie Player (Music Player) DidUknowiPwn 4 8,086 06-24-2013, 16:37
Last Post: DidUknowiPwn

Forum Jump:


Users browsing this thread:
1 Guest(s)

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