Bierbuikje Posted September 25, 2009 Share Posted September 25, 2009 Hello everyone, Is it possible to create a random number with a cleo opcode? I thougt about someting like this: AAAA: get_random_number_between [email protected] and [email protected] handle_as [email protected] Is there a way/is it possible to create a random number like this or ain't it possible to create random numbers? Thank you very much, Bierbuikje Link to comment Share on other sites More sharing options...
Adler Posted September 25, 2009 Share Posted September 25, 2009 0209: handle = random_int_in_ranges int int lol You color your vars too. Link to comment Share on other sites More sharing options...
coin-god Posted September 25, 2009 Share Posted September 25, 2009 0209: handle = random_int_in_ranges int int lol You color your vars too. You can also use this: 0208: [email protected] = random_float_in_ranges -0.2 0.2 Float not integer. btw: OP Your blue vars hurt my eyes with the connection board theme. Link to comment Share on other sites More sharing options...
Bierbuikje Posted September 27, 2009 Author Share Posted September 27, 2009 Thanks a lot, it works perfectly. And does anyone know if i can put variables in my .FXT files? Cause now a ped is saying: - ~R~Dealer~w~: You mad a lot of money! And I want him to say: - ~R~Dealer~w~: You earned ~R~$MONEY (Variable of the money)~w~ dollar. Thats nice! The outcome would be: - Dealer: You earned 1000 dollar. Thats nice! or - Dealer: You earned 4532 dollar. Thats nice! Is it possible to do something like this? Thanks a lot! Link to comment Share on other sites More sharing options...
Wesser Posted September 27, 2009 Share Posted September 27, 2009 (edited) Just use the opcode "01E5" and write in your .gxt\.fxt string "~1~". That is important to print your var value on screen. YOURTXT ~R~Dealer~w~: You earned ~R~~1~~w~ dollar. Thats nice!01E5: show_text_1number_highpriority GXT 'YOURTXT' number [email protected] time 5000 flag 1 Edit: However, Seemann has implemented an internal function which helps you to get a random value fastly. [email protected] = random([email protected], [email protected]) Edited September 27, 2009 by Wesser 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ 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