Quantcast

Jump to content

» «
Photo

A little help over here. [SA]

2 replies to this topic
mikeg_
  • mikeg_

    Player Hater

  • New Members
  • Joined: 01 Sep 2014
  • Argentina

#1

Posted 01 September 2014 - 07:11 PM

Hi all.
 
Well I'm trying to create something like the slot machines (without the machine, only textures) of three rolls but I need a little help because I'm a newbie and I don't know how to do what i want.

Here is my code: 
 

 

{$CLEO .cs}
 
0000: NOP                                                          
 
03F0: enable_text_draw 1
03E3: set_texture_to_be_drawn_antialiased 1
 
:MIKEG_1
wait 0
0390: load_txd_dictionary "LD_SLOT"
038F: load_texture "R_69" as 1 // Load dictionary with 0390 first 
038F: load_texture "GRAPES" as 2 // Load dictionary with 0390 first 
038F: load_texture "CHERRY" as 3 // Load dictionary with 0390 first 
038F: load_texture "BELL" as 4 // Load dictionary with 0390 first 
038F: load_texture "BAR2_O" as 5 // Load dictionary with 0390 first 
038F: load_texture "BAR1_O" as 6 // Load dictionary with 0390 first
038F: load_texture "R_69" as 7 // Load dictionary with 0390 first 
038F: load_texture "GRAPES" as 8 // Load dictionary with 0390 first 
038F: load_texture "CHERRY" as 9 // Load dictionary with 0390 first 
038F: load_texture "BELL" as 10 // Load dictionary with 0390 first 
038F: load_texture "BAR2_O" as 11 // Load dictionary with 0390 first 
038F: load_texture "BAR1_O" as 12 // Load dictionary with 0390 first
jump @MIKEG_2
 
:MIKEG_2
wait 0
if and
00ED: actor $PLAYER_ACTOR sphere 0 near_point $X $Y radius 0.2 0.2 on_foot
0ADC: "slot"
else_jump @MIKEG_2
0209: 31@ = random_int_in_ranges 1 12
0209: 30@ = random_int_in_ranges 1 5
0209: 29@ = random_int_in_ranges 1 3
0209: 28@ = random_int_in_ranges 1 8
0209: 27@ = random_int_in_ranges 1 10
0209: 26@ = random_int_in_ranges 1 12
0209: 25@ = random_int_in_ranges 1 7
0209: 24@ = random_int_in_ranges 1 8
0209: 23@ = random_int_in_ranges 1 12
 
038D: draw_texture 31@ position 225.0 200.0 size 64.0 64.0 RGBA 255 255 255 255 // X - -
038D: draw_texture 28@ position 225.0 250.0 size 64.0 64.0 RGBA 255 255 255 255 // X - -                                                                                
038D: draw_texture 27@ position 225.0 300.0 size 64.0 64.0 RGBA 255 255 255 255 // X - -
 
038D: draw_texture 30@ position 325.0 200.0 size 64.0 64.0 RGBA 255 255 255 255 // - X -
038D: draw_texture 26@ position 325.0 250.0 size 64.0 64.0 RGBA 255 255 255 255 // - X -
038D: draw_texture 25@ position 325.0 300.0 size 64.0 64.0 RGBA 255 255 255 255 // - X -
 
038D: draw_texture 29@ position 425.0 200.0 size 64.0 64.0 RGBA 255 255 255 255 // - - X
038D: draw_texture 24@ position 425.0 250.0 size 64.0 64.0 RGBA 255 255 255 255 // - - X
038D: draw_texture 23@ position 425.0 300.0 size 64.0 64.0 RGBA 255 255 255 255 // - - X
jump @MIKEG_3
 
:MIKEG_3
wait 0
if and 
003B: 28@ == 26@ 
003B: 28@ == 24@
003B: 26@ == 28@ 
003B: 26@ == 24@
003B: 24@ == 26@ 
003B: 24@ == 28@  
else_jump @MIKEG_4
038E: draw_box_position 325.0 250.0 size 300.0 15.0 RGBA 255 0 0 255
jump @MIKEG_2
 
:MIKEG_4
wait 0
if and 
003B: 31@ == 30@
003B: 31@ == 29@
003B: 30@ == 31@
003B: 30@ == 29@
003B: 29@ == 31@
003B: 29@ == 30@    
else_jump @MIKEG_5
038E: draw_box_position 325.0 200.0 size 300.0 15.0 RGBA 0 83 166 255
jump @MIKEG_2
 
:MIKEG_5
wait 0
if and
003B: 27@ == 25@
003B: 27@ == 23@
003B: 25@ == 27@
003B: 25@ == 23@
003B: 23@ == 27@
003B: 23@ == 25@         
else_jump @MIKEG_2
038E: draw_box_position 325.0 300.0 size 300.0 15.0 RGBA 0 0 110 255
jump @MIKEG_2                                    

I want to script this like a real slot machine, if the player if near a point then create the textures and if the player type slot then change the textures in random numbers in 5 seconds. So... that must be something like this:

if the player is near the point then create the textures and if the player type slot then change al the texture in random numbers for 5 seconds then stop and check if he won or not.


goodidea82
  • goodidea82

    SA Modder

  • Members
  • Joined: 13 Jun 2013

#2

Posted 02 September 2014 - 06:58 PM

It seems that DK manages to set the textures of a car here: http://gtaforums.com...c/?p=1061550765

Maybe you can research in this direction.


mikeg_
  • mikeg_

    Player Hater

  • New Members
  • Joined: 01 Sep 2014
  • Argentina

#3

Posted 03 September 2014 - 03:17 PM

It seems that DK manages to set the textures of a car here: http://gtaforums.com...c/?p=1061550765

Maybe you can research in this direction.

No, that is not what i want. Look at the pic:

Vn0IT3M.jpg
 

I want to draw that textures if the actor is near a point then if he type "slot", change all textures for random ones for 5 seconds and then check if he win or not. 
 
So maybe for draw the textures can jump to a loop and draw them but i don't know how to put the condition if he type "slot" and change all the textures for 5 seconds.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users