CLEO Help Mod ignores "wait"

CLEO related
Status
Not open for further replies.

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Code:
072A: put_actor $PLAYER_ACTOR into_car 0@ driverseat
wait 5000
0AD1: "5 seconds passed" 1500

The text shows immediately after the actor is placed inside the car, do you know what may be the reason of it?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Code:
{$CLEO .cs}
0000: NOP

0B34: samp register_client_command "rain" to_label @start
0B34: samp register_client_command "rainfew" to_label @start_few
0B34: samp register_client_command "count" to_label @count_cars
0B34: samp register_client_command "savepos" to_label @save_pos
0B34: samp register_client_command "rainpos" to_label @rain_pos
0B34: samp register_client_command "delpos" to_label @del_pos
0B34: samp register_client_command "carpos" to_label @car_pos
0B34: samp register_client_command "raininfo" to_label @Info
29@ = 0

:First
wait 0
if 29@ == 1
jf @First     
0B2E: 11@ = read_samp_memory 0x12D60 size 2
0B2D: write samp_memory 0x12D60 value 0xC390 size 2
0B2E: 12@ = read_samp_memory 0x13FA0 size 2
0B2D: write samp_memory 0x13FA0 value 0xC390 size 2
0B2E: 13@ = read_samp_memory 0x4830 size 1
0B2D: write samp_memory 0x4830 value 0xC3 size 1
wait 500
for 5@ = 0 to 999
     if 0AFF: samp 0@ = car_handle_by_samp_vehicle_id 5@
     then
        0B30: samp send_enter_vehicle 5@ as_passenger false
        00AB: put_car 0@ at 21@ 22@ 23@ 
        23@ += 3.0
        0AB1: call_scm_func @SYNC_INN 1 HANDLE 0@
        wait 0
        0AB1: @SYNC_OUT 0
        wait 0
        0B31: samp send_exit_vehicle 5@
            if                     //5 cars max
            0029:   23@ > 20@ //5 cars max
            then                //5 cars max
            jump @Second         //5 cars max
            end                   //5 cars max
     
               
     end 
end
:Second   //5 cars max
wait 0
0B2D: write samp_memory 0x12D60 value 11@ size 2
0B2D: write samp_memory 0x13FA0 value 12@ size 2
0B2D: write samp_memory 0x4830 value 13@ size 1
wait 500
29@ = 0
20@ = 0 //reset 20 value to make it work later
jump @First

:SYNC_INN
0A97: 2@ = car 0@ struct
0A96: 3@ = actor $PLAYER_ACTOR struct
3@ += 1328
0A8C: write_memory 3@ size 4 value 50 virtual_protect 0
0A96: 3@ = actor $PLAYER_ACTOR struct
3@ += 1420
0A8C: write_memory 3@ size 4 value 2@ virtual_protect 0
0AB2: ret 0

:SYNC_OUT
0A96: 0@ = actor $PLAYER_ACTOR struct
0@ += 0x530 // State = 0, leaving car
0A8C: write_memory 0@ size 4 value 1 virtual_protect 0 
0AB2: ret 0  

:start
wait 0 
   SAMP.IsCommandTyped(31@)
     if
     0AD4: 30@ = scan_string 31@ format "%d" 6@
     then
         if
         0B23:  samp is_player_connected 6@
         jf @Not_connected
     0B20: samp 28@ = actor_handle_by_samp_player_id 6@
        if 
        056D:   actor 28@ defined
        jf @Too_far
     00A0: store_actor 28@ position_to 21@ 22@ 23@
     0085: 20@ = 23@
     20@ += 1000.0
     jump @Activation
     end

:start_few
wait 0 
   SAMP.IsCommandTyped(27@)
if 
0AD4: 30@ = scan_string 27@ format "%d %d" 6@ 7@
else_jump @First
    if
         0B23:  samp is_player_connected 6@
         jf @Not_connected
     0B20: samp 28@ = actor_handle_by_samp_player_id 6@
        if 
        056D:   actor 28@ defined
        jf @Too_far
00A0: store_actor 28@ position_to 21@ 22@ 23@
0085: 20@ = 23@ 
   if
   7@ == 1
   then
    20@ += 2.0       //1 car max
   end
   if
   7@ == 2
   then
    20@ += 5.0       //2 car max
   end                                          
   if
   7@ == 3
   then
    20@ += 8.0       //3 car max
   end
   if
   7@ == 4
   then
    20@ += 11.0       //4 car max
   end
   if
   7@ == 5
   then
    20@ += 14.0       //5 car max
   end
   if
   7@ == 6
   then
    20@ += 17.0       //6 car max
   end
   if
   7@ == 7
   then
    20@ += 20.0       //7 car max
   end
      if
   7@ == 8
   then
    20@ += 23.0       
   end
      if
   7@ == 9
   then
    20@ += 26.0      
   end
      if
   7@ == 10
   then
    20@ += 29.0      
   end
      if
   7@ == 11
   then
    20@ += 32.0       
   end
      if
   7@ == 12
   then
    20@ += 35.0       
   end
      if
   7@ == 13
   then
    20@ += 38.0       
   end
      if
   7@ == 14
   then
    20@ += 41.0       
   end
      if
   7@ == 15
   then
    20@ += 44.0       
   end
      if
   7@ == 16
   then
    20@ += 47.0       
   end
      if
   7@ == 17
   then
    20@ += 50.0      
   end
      if
   7@ == 18
   then
    20@ += 52.0      
   end
      if
   7@ == 19
   then
    20@ += 55.0       
   end
      if
   7@ == 20
   then
    20@ += 58.0       
   end
      if
   7@ == 21
   then
    20@ += 61.0       
   end
      if
   7@ == 22
   then
    20@ += 64.0       
   end
      if
   7@ == 23
   then
    20@ += 67.0       
   end
      if
   7@ == 24
   then                                     
    20@ += 70.0       
   end
      if
   7@ == 25
   then
    20@ += 73.0       
   end
      if
   7@ == 26
   then
    20@ += 76.0       
   end
      if
   7@ == 27
   then
    20@ += 79.0       
   end
      if
   7@ == 28
   then
    20@ += 85.0       
   end
      if
   7@ == 29
   then
    20@ += 88.0       
   end
      if
   7@ == 30
   then
    20@ += 91.0       
   end
      if
   7@ == 31
   then
    20@ += 94.0       
   end
   if
   7@ == 32
   then
    20@ += 97.0       
   end
   if
   7@ == 33
   then
    20@ += 100.0       
   end
   if
   7@ == 34
   then
    20@ += 103.0       
   end
   if                          
   7@ == 35                     
   then 20@ += 107.0            
   end                 
   if                  
   7@ == 36
   then                     
    20@ += 110.0            
   end                         
   if                  
   7@ == 37
   then                       
    20@ += 113.0              
   end
   if                         
   7@ == 38
   then
    20@ += 116.0       
   end                            
   if
   7@ == 39
   then                         
    20@ += 119.0       
   end
   if
   7@ == 40
   then
    20@ += 122.0       
   end
   if
   7@ == 41
   then
    20@ += 125.0       
   end                                     
   if
   7@ == 42                      
   then
    20@ += 128.0       
   end
   if
   7@ == 43
   then
    20@ += 131.0       
   end
   if                                              
   7@ == 44                 
   then
    20@ += 134.0        
   end                             
   if                       
   7@ == 45
   then
    20@ += 137.0       
   end
   if                                      
   7@ == 46                            
   then
    20@ += 140.0               
   end                                  
   if
   7@ == 47                                 
   then
    20@ += 143.0       
   end
   if                                     
   7@ == 48
   then
    20@ += 146.0       
   end
   if
   7@ == 49
   then
    20@ += 149.0       
   end                        
   if
   7@ == 50
   then
    20@ += 152.0       
   end
   if                                        
   7@ == 51
   then
    20@ += 155.0       
   end
   if
   7@ == 52
   then
    20@ += 158.0       
   end
   if
   7@ == 53
   then
    20@ += 161.0       
   end
   if
   7@ == 54                                  
   then
    20@ += 164.0       
   end
   if
   7@ == 55
   then
    20@ += 167.0       
   end
   if
   7@ == 56
   then
    20@ += 170.0       
   end
   if
   7@ == 57
   then
    20@ += 173.0       
   end
   if
   7@ == 58
   then
    20@ += 176.0       
   end
   if                                              
   7@ == 59
   then                                                       
    20@ += 179.0       
   end
   if
   7@ == 60
   then
    20@ += 182.0       
   end
jump @Activation
            
:Activation 
wait 0
03BD: destroy_sphere 14@ 
29@ = 1    // = 1 make it active
SAMP.CmdRet
goto @First 

:save_pos
wait 0
03BD: destroy_sphere 14@
00A0: store_actor $PLAYER_ACTOR position_to 21@ 22@ 23@
03BC: 14@ = create_sphere_at 21@ 22@ 23@ radius 15.0
018C: play_sound 1052 at 0.0 0.0 0.0
0085: 20@ = 23@
20@ += 1000.0
0AD1: show_formatted_text_highpriority "Position saved" time 800
SAMP.CmdRet
jump @First

:rain_pos
wait 0
if 
0029:   20@ > 23@
then
jump @Activation
end
SAMP.CmdRet
jump @First

:del_pos
wait 0
03BD: destroy_sphere 14@
018C: play_sound 1053 at 0.0 0.0 0.0
20@ = 0
21@ = 0 
22@ = 0
23@ = 0
0AD1: show_formatted_text_highpriority "Position deleted" time 800
SAMP.CmdRet
jump @First

:count_cars
wait 0
10@ = 0
for 8@ = 0 to 999
     if 0AFF: samp 9@ = car_handle_by_samp_vehicle_id 8@
     then 10@++          
     end
end
0AD1: "~B~%d ~W~streamed vehicles" 1000 10@
wait 100
SAMP.CmdRet
jump @First


:Info
wait 0
0AF8: samp add_message_to_chat "{00A4E6}rain.cs commands:" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/rain {00A4E6}<ID> {F7F694}(set rain over specific player) " color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/rainfew {00A4E6}<ID> <number of cars> {F7F694}(set rain over specific player with custom amount of cars, max 60 cars)" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/count {F7F694}(check how many cars are available around)" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/savepos {F7F694}(saves your current position)" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/rainpos {F7F694}(set rain over your last saved position)" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/carpos {00A4E6} <ID> {F7F694}(place specific vehicle at your last saved position)" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/delpos {F7F694}(deletes your last saved position)" color 0xFFFFFFFF
SAMP.CmdRet
jump @First   

:Not_connected
wait 0
0AD1: "~R~Invalid ID" 1000
SAMP.CmdRet
jump @First
  

:Too_far
wait 0
0AD1: "~R~Desired player is too far away" 1000
SAMP.CmdRet
jump @First

:car_pos
wait 0
SAMP.IsCommandTyped(28@)
     if
     0AD4: 27@ = scan_string 28@ format "%d" 15@
     then
     0AFF: samp 0@ = car_handle_by_samp_vehicle_id 15@
     end
        if
        056E:   car 0@ defined
        then
        //0B2E: 11@ = read_samp_memory 0x12D60 size 2
        //0B2D: write samp_memory 0x12D60 value 0xC390 size 2
        //0B2E: 12@ = read_samp_memory 0x13FA0 size 2
        //0B2D: write samp_memory 0x13FA0 value 0xC390 size 2
        //0B2E: 13@ = read_samp_memory 0x4830 size 1
        //0B2D: write samp_memory 0x4830 value 0xC3 size 1
       // wait 500        
        00AB: put_car 0@ at 21@ 22@ 23@
        00A0: store_actor $PLAYER_ACTOR position_to 24@ 25@ 26@
        072A: put_actor $PLAYER_ACTOR into_car 0@ driverseat
        wait 5000 
        0AD1: "5 seconds passed" 1500
        //0B30: samp send_enter_vehicle 15@ as_passenger false           
        //0B31: samp send_exit_vehicle 15@
        
       // 0362: remove_actor $PLAYER_ACTOR from_car_and_place_at 24@ 25@ 26@                                           
  //      0AB1: call_scm_func @SYNC_INN 1 HANDLE 0@
 //       wait 0
 //       0AB1: @SYNC_OUT 0
//        wait 0
        
        //0B2D: write samp_memory 0x12D60 value 11@ size 2
        //0B2D: write samp_memory 0x13FA0 value 12@ size 2
        //0B2D: write samp_memory 0x4830 value 13@ size 1 
        //wait 500       
        03BD: destroy_sphere 14@
        018C: play_sound 1053 at 0.0 0.0 0.0
        else_jump @Too_far_car
        SAMP.CmdRet
        end
jump @First

:Too_far_car
wait 0
0AD1: "~R~Desired vehicle is too far away" 1000
SAMP.CmdRet
jump @First
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
monday link said:
Hmm, is there any alternative?
hmm i see no related with cmd and wait

try to just place the massage away from the code , like putting the code first and all codes follow then add the massage , and separate the wait  :trollface:

OR you can make a gosub command and there add wait , it should work
 

TheZeRots

Expert
Joined
Dec 21, 2013
Messages
1,247
Reaction score
1
Opcode.eXe link said:
I had this problem too. I think you cant use wait in a command. I'm not sure because i dont use wait anymore^^

I've used it with a command plenty of times, does work. Perhaps not with specific opcodes?
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
Try to use this instead of wait...

$wait = 0

:WAIT
wait 0
if
$wait == 500
jf @PLUS1
print "5 seconds passed" 2000
$wait = 0
goto @WAIT

:pLUS1
wait 0
0008: $wait += 1
goto @WAIT
 

m1zg4rd_PL

Well-known member
Joined
Jul 19, 2013
Messages
222
Reaction score
0
Try to make something like (it's not real code):

Code:
0@ = 0
register cmd to @Enable

while true
  if
    0@ == 1
  then
    0@ = 0
    //some code here
  end
end

:Enable
0@ = 1
SAMP.CmdRet
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
TH3RM4L link said:
Try to use this instead of wait...

$wait = 0

:WAIT
wait 0
if
$wait == 500
jf @PLUS1
print "5 seconds passed" 2000
$wait = 0
goto @WAIT

:pLUS1
wait 0
0008: $wait += 1
goto @WAIT

nice idea  :yesyes: , but why not define the wait to 500 in the first place?
like :


EDIT : lel never mind
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Thank you all for help but nothing seems to work.
I tried GOSUB, registering the command to another label, $wait/PLUS1, nothing seems to work, the message is always immediate.
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
you should use gosub like

in the main you call it
gosub @sub

:sub
wait 5000 //here is the wait
//do your stuff here
return
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I realised that I made mistake while registering the command to another label. It works properly with m1zg4rd's advice

Code:
0@ = 0
register cmd to @Enable

while true
  if
    0@ == 1
  then
    0@ = 0
    //some code here
  end
end

:Enable
0@ = 1
SAMP.CmdRet

(I was unaware that Samp.CmdRet jumps the code to the begining therefore everything below it becomes inactive)

Thank you all:)
 
Status
Not open for further replies.
Top