Choosing a vehicle model ID
#4

You could use random(211) + 400 to generate a model between 400 and 611 and check if the model is OK, if it's not then generate a new model. At least I understood that this is what you want. :P

Something like that I guess:
Код:
new model;

generate_model:
model = random(211) + 400;

if (model == 519) goto generate_model; //if the vehicle is Shamal (just an example) then generate a new model
Not sure if goto is good, because wiki says "The use of gotos is widely discouraged due to their effect on program flow."
Or you could do it like this:
Код:
new model = random(211) + 400;

while (modelid == 519) //it will keep generating a new model if the model is a Shamal
{
   model = random(211) + 400;
}
Reply


Messages In This Thread
Choosing a vehicle model ID - by JaKe Elite - 18.11.2016, 11:14
Re: Choosing a vehicle model ID - by TonyII - 18.11.2016, 12:33
Re: Choosing a vehicle model ID - by JaKe Elite - 18.11.2016, 12:54
Re: Choosing a vehicle model ID - by GoldenLion - 18.11.2016, 13:28
Re: Choosing a vehicle model ID - by Dayrion - 18.11.2016, 13:52
Re: Choosing a vehicle model ID - by JaKe Elite - 19.11.2016, 03:31
Re: Choosing a vehicle model ID - by JaKe Elite - 19.11.2016, 05:27
Re: Choosing a vehicle model ID - by BroZeus - 19.11.2016, 06:43
Re: Choosing a vehicle model ID - by Vince - 19.11.2016, 08:35
Re: Choosing a vehicle model ID - by GoldenLion - 19.11.2016, 20:00

Forum Jump:


Users browsing this thread: 1 Guest(s)