Administrator keNN. Posted July 30, 2018 Administrator Share Posted July 30, 2018 Functia clasica random( max ) genereaza o valore aleatorie de la 0 pana la max (valoarea maxima pe care numarul extras aleatoriu o poate avea). Dar ce facem daca vrem sa o obtinem o valoare cuprinsa inte x si y... De aceea exista randomEx( min, max ) care genereaza o valoare de la min (valoarea maxima pe care numarul extras aleatoriu o poate avea) pana la max (valoarea maxima pe care numarul extras aleatoriu o poate avea). stock randomEx( min, max ) return random( max - min ) + min; Exemplu de utilizare: new vID = CreateVehicle( params[ 0 ], Place[ 0 ], Place[ 1 ], Place[ 2 ], 0, randomEx( 128, 255 ), randomEx( 128, 255 ), -1, 0 ); Credite: Y_Less Topic creat de catre: Kingsley Leonard 1 Te-ai inregistrat? Ne-ar placea sa te prezinti. Alatura-te grupului nostru de Discord. Link to comment Share on other sites More sharing options...
regeletau Posted January 19, 2019 Share Posted January 19, 2019 frumos tutorial, multumim. _________________________________________________ | _________ | | | / /| |\ | / \ | | | / / | | \ | | | | |/ / | | \ | | | | |\ | | \ | | _____ | | | \ | | \ | | \ | | | \ | | \ | | | | | | \ | | \| \_________/ | |_______________________________________________| Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now