08-28-2011, 01:23
08-28-2011, 02:04
Lol. the Array with the Weapons dont makes sense. :O
U define the Array[priamrywepsize] 100 times. why?
U define the Array[priamrywepsize] 100 times. why?
08-28-2011, 05:57
So... what's the error?
You mean the first bit? He's just adding new elements to the array.
(08-28-2011, 02:04)Tomsen1410 Wrote: [ -> ]Lol. the Array with the Weapons dont makes sense. :O
U define the Array[priamrywepsize] 100 times. why?
You mean the first bit? He's just adding new elements to the array.
08-28-2011, 06:21
line 359, replace with
Code:
else
Code:
} else {
08-28-2011, 19:55
(08-28-2011, 05:57)Phl3x_ Wrote: [ -> ]So... what's the error?
(08-28-2011, 02:04)Tomsen1410 Wrote: [ -> ]Lol. the Array with the Weapons dont makes sense. :O
U define the Array[priamrywepsize] 100 times. why?
You mean the first bit? He's just adding new elements to the array.
I think the primarywepsize hs an entity for example 1. when he dfines the array[1] 100 tikes it dont makes ense? or did i miss something? :O
08-28-2011, 22:04
(08-28-2011, 19:55)Tomsen1410 Wrote: [ -> ]I think the primarywepsize hs an entity for example 1. when he dfines the array[1] 100 tikes it dont makes ense? or did i miss something? :O
When he creates the array, it has a size of 0, and after each element that's added, the size increases.
PHP Code:
level.PrimaryWeapon = [];
// PrimaryWeapon.size is 0
level.PrimaryWeapon[level.PrimaryWeapon.size] = "mp5k_mp";
// PrimaryWeapon.size is now 1
level.PrimaryWeapon[level.PrimaryWeapon.size] = "skorpion_mp";
// PrimaryWeapon.size is now 2 etc
08-28-2011, 22:06
is:
correct? o_O
isn't :
self.PrimaryToGive = random(level.mp5k_attach[level.mp5k_attach.size]);
supposed to be
self.PrimaryToGive = level.mp5k_attach[ RandomInt( level.mp5k_attach.size ) ];
Code:
Random( level.var[ level.var.size ] );
correct? o_O
isn't :
self.PrimaryToGive = random(level.mp5k_attach[level.mp5k_attach.size]);
supposed to be
self.PrimaryToGive = level.mp5k_attach[ RandomInt( level.mp5k_attach.size ) ];
08-28-2011, 22:47
i already fixed it for him over steam chat yesterday, he didn't update the post.
and @iAegle
AFAIK this is random (its already built-in):
and @iAegle
Code:
self.PrimaryToGive = random(level.mp5k_attach);
works
AFAIK this is random (its already built-in):
Code:
random( array )
{
return array[randomInt(array.size)];
}
08-28-2011, 23:14
ok. didnt knew.