SA-MP Forums Archive
[Doubt] How to do this. - 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)
+--- Thread: [Doubt] How to do this. (/showthread.php?tid=636828)



[Doubt] How to do this. - Tirael - 04.07.2017

I am trying to make a random number with numbers that I provide but I do not deal with the form.

pawn Код:
new Number[MAX_BUSINNES] = 0;
for (new i = 0; i < MAX_BUSINNES; i ++)
{
    if (NegociosInfo[i][bizType] == 1)
    {
        Number[i] = 1;
    }
}
// here would go random ...
Sorry for my bad english.
So far everything is correct but the question is, how can I create a randon with the number function in 1?.
+ Rep who help me.


Re: [Doubt] How to do this. - Eoussama - 04.07.2017

Let me get you straight, you want to generate a random number?


Respuesta: Re: [Doubt] How to do this. - Tirael - 04.07.2017

A random number with the function Number [i] = 1;


Re: [Doubt] How to do this. - Eoussama - 04.07.2017

Can you be more explicit?
Do you mean you want to generate random numbers and store them in the Number array? Like
PHP код:
Number[0] = 54515;
Number[1] = 41726;
Number[2] = 57756;
Number[3] = 25254;
//...etc.. 
like this?


Respuesta: [Doubt] How to do this. - Tirael - 04.07.2017

My idea is to loop through all Type 1 businesses and store their IDS.
Example:
Business 1, 5, 8, 20.

As I can store those images and then create a loop that does not sea in correlative order if not the 1, 5, 8, 20.

My idea is for the job of truck driver, to look for certain businesses and send it to one obtained at random through the loop.


Re: [Doubt] How to do this. - SpaceX - 04.07.2017

What is NegociosInfo?


Respuesta: [Doubt] How to do this. - Tirael - 05.07.2017

Solved.