Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Random List Selector
#1
For example

I have

weapons[] = [];
weapons[1]= "shit_sp"
weapons[2]= "poo_sp"

and

weapons2[] = [];
weapons2[1]= "test_sp"
weapons2[2]= "wazza_sp"

weapon = weapons[RandomInt(weapons.size)];
weapon2 = weapons2[RandomInt(weapons2.size)];

can I add another random that select one of those 2 list randomly?
Reply

#2
Code:
derp[] = [];
derp[1]= "shit_sp"
derp[2]= "poo_sp"
derp[3]= "test_sp"
derp[4]= "wazza_sp"

derp1 = derp[RandomInt(derp.size)];



this?


OR

Code:
weapon[] = [];
weapon[1] = weapons[RandomInt(weapons.size)];
weapon[2] = weapons2[RandomInt(weapons2.size)];
weapon = weapon[RandomInt(weapon.size)];



Never needed to use rand ints, but by the look of how you done it they should work?
Reply

#3
(08-05-2011, 20:11)koil Wrote:
Code:
derp[] = [];
derp[1]= "shit_sp"
derp[2]= "poo_sp"
derp[3]= "test_sp"
derp[4]= "wazza_sp"

derp1 = derp[RandomInt(derp.size)];



this?


OR

Code:
weapon[] = [];
weapon[1] = weapons[RandomInt(weapons.size)];
weapon[2] = weapons2[RandomInt(weapons2.size)];
weapon = weapon[RandomInt(weapon.size)];



Never needed to use rand ints, but by the look of how you done it they should work?

I will use 2nd thx (seems to be he best)

hum how I am gonna give me the weapon?
Reply

#4
np, atleast i know how to make rand weapon selection now Big Grin
Reply

#5
(08-05-2011, 20:24)koil Wrote: np, atleast i know how to make rand weapon selection now Big Grin

hum how am I gonna give myself the weapon with your code?
Reply

#6
take all weapons - if u need to.. then just..

self giveweapon( weapon );

should work?
Reply

#7
(08-05-2011, 20:27)koil Wrote: take all weapons - if u need to.. then just..

self giveweapon( weapon );

should work?

lol nvm your code doesnt work I get unitialised varaible for the weapons in
weapons[RandomInt(weapons.size)];
Reply

#8
does ur original post work?
Reply

#9
(08-05-2011, 20:40)koil Wrote: does ur original post work?

yep
Reply

#10
weapons[] = [];
weapons[1]= "shit_sp"
weapons[2]= "poo_sp"

weapons2[] = [];
weapons2[1]= "test_sp"
weapons2[2]= "wazza_sp"

weapon[] = [];
weapon[1] = weapons[RandomInt(weapons.size)];
weapon[2] = weapons2[RandomInt(weapons2.size)];

endweapon = undefined;
endweapon = weapon[RandomInt(weapon.size)];

self giveweapon( endweapon );




Try that.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 4,106 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 4,708 11-08-2013, 05:25
Last Post: [HARD] Tony.
  Help choose 2 random players?(1 each team) 26hz 6 4,651 09-12-2013, 17:32
Last Post: Yamato
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,295 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,739 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Receiving a random primary & secondary DidUknowiPwn 5 4,406 07-22-2013, 09:47
Last Post: Yamato
  Help Server not in list, but people join 99IRock 8 7,105 07-17-2013, 21:26
Last Post: clacki
  List of models that can be spawned? (Looking for C4 model) akillj 5 4,799 06-27-2013, 13:35
Last Post: Yamato
  [Request] mw3 all map list ( aslo DLC) raminr63 5 14,973 06-18-2013, 19:50
Last Post: mn_acer1
Big Grin Killstreaks HUD list Puffiamo 9 9,932 06-18-2013, 18:42
Last Post: RaZ

Forum Jump:


Users browsing this thread:
7 Guest(s)

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