Random car select
#1

Hi i have a random car select system:

Код:
new car[72] = { 448, 437, 427, 490, 407, 596, 420, 423, 442, 583, 409, 571, 522, 586, 524, 578, 443, 531, 515, 471, 509, 462, 573, 411, 485, 457, 483, 508, 532, 406, 486, 588, 572, 574, 539, 418, 602, 429, 502, 411, 416, 431, 438, 544, 601, 568, 579, 556, 575, 499, 482, 455, 408, 478, 554, 480, 555, 533, 408, 416, 428, 433, 440, 451, 461, 463, 468, 495, 528, 530, 601, 609 };
and when i need it i do
Код:
new var0 = random(36);
giveplayervehicle(car[var1]xyz eetc
It works only the system is not realy random, how can i make it realy random
Reply
#2

pawn Код:
new car[72] = { 448, 437, 427, 490, 407, 596, 420, 423, 442, 583, 409, 571, 522, 586, 524, 578, 443, 531, 515, 471, 509, 462, 573, 411, 485, 457, 483, 508, 532, 406, 486, 588, 572, 574, 539, 418, 602, 429, 502, 411, 416, 431, 438, 544, 601, 568, 579, 556, 575, 499, 482, 455, 408, 478, 554, 480, 555, 533, 408, 416, 428, 433, 440, 451, 461, 463, 468, 495, 528, 530, 601, 609 };
This should do it:
pawn Код:
new var1 = random(sizeof(car));
giveplayervehicle(car[var1]xyz eetc
Reply
#3

why random(7)? i think there should be random(car[]) (but I dont know what to write in the "[]").
Reply
#4

Quote:
Originally Posted by Scott[LT
]
why random(7)? i think there should be random(car[]) (but I dont know what to write in the "[]").
xD, i just said it in the post above yours
Reply
#5

thanks no zero, rofl i just discoverd a bug i didnt notice for almsot 4months
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)