Random weapon and ammo
#1

Код:
new warray[] = {16, 22, 24, 26, 27, 29, 31, 36, 38, 39};
new wp = random(sizeof(warray));
new amo = random(82);
GivePlayerWeapon(playerid, wp, amo);
"warray" is never used? !
Reply
#2

No it isn't. You use sizeof, which will simply return the size of the array (10). As a result you will you get a random value between 0 and 9 for the variable wp instead of an actual random value from the array.

pawn Код:
new wp = warray[random(sizeof(warray))];
Reply
#3

Thanks REP++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)