SA-MP Forums Archive
Random car select - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random car select (/showthread.php?tid=82935)



Random car select - hipy - 21.06.2009

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


Re: Random car select - [nl]daplayer - 21.06.2009

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



Re: Random car select - arnutisz - 21.06.2009

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


Re: Random car select - [nl]daplayer - 21.06.2009

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


Re: Random car select - hipy - 22.06.2009

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