• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help What's wrong with this?
#1
http://codepad.org/jo9K6bAw


Nyan Cat
  Reply
#2
Lol. the Array with the Weapons dont makes sense. :O
U define the Array[priamrywepsize] 100 times. why?
  Reply
#3
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.
  Reply
#4
line 359, replace
Code:
else
with
Code:
} else {
helped ya? rep me +
  Reply
#5
(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
  Reply
#6
(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 
  Reply
#7
is:
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-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
#8
i already fixed it for him over steam chat yesterday, he didn't update the post.

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)];
}
[Image: b_560_95_1.png]
  Reply
#9
ok. didnt knew.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help What's Wrong 2 Dominator56 5 1,705 02-19-2013, 21:46
Last Post: Dominator56
  Help What's wrong ? Dominator56 4 1,429 02-17-2013, 12:12
Last Post: Dominator56
  I know I've posted this in a wrong place Ra3shed 2 1,096 02-16-2013, 21:15
Last Post: Arteq
Exclamation No site change after 12 rounds... Bug or wrong settings? ChrisPiHD 1 1,142 09-21-2012, 18:16
Last Post: estebespt
  Something wrong with background Arteq 2 1,145 02-27-2012, 17:01
Last Post: Arteq
Question A very, very annoying thing, what is wrong? I don't see it. xplosiff 1 905 12-30-2011, 09:27
Last Post: met94
  lol whats wrong? skata3000 0 842 10-02-2011, 22:35
Last Post: skata3000
  [Release] Oopz wrong forum JariZ 3 1,072 07-08-2011, 09:57
Last Post: surtek
  what's wrong with this coding? cervantes 14 2,942 07-04-2011, 07:21
Last Post: tadej
  What's wrong with this script? kikimo900 4 1,116 07-02-2011, 00:19
Last Post: kikimo900

Forum Jump:


Users browsing this thread: 1 Guest(s)