CLEO Help why this script doesn't turn off

CLEO related
Status
Not open for further replies.

hasin1

Active member
Joined
Jan 22, 2014
Messages
55
Reaction score
0
Having trouble with this script which I bodged together using other peoples work :fuck_yea:  but I cannot turn the script off ingame  :computer_guy:

Also the whole gta keeps shaking


Code:
{$CLEO .cs}
0000: NOP


wait 0
1@ = 0

while true
wait 0     
   if and
   0AB0:   key_pressed  57
   1@ == 0
   then
   1@ = 1
   0AD1: show_formatted_text_highpriority "~G~ACTIVATED" time 500
   else
      if and
      0AB0:   key_pressed  57
      1@ == 1
      then
      1@ = 0
      0AD1: show_formatted_text_highpriority "~R~DEACTIVATED" time 500
      end
   end
0AC8: 0@ 256
0AC8: 2@ 256


0AFA:   is_samp_structures_available


if
    1@ == 1
    then
    wait 5000
    0AB1: call @keyPress 2 key 16 time 500
    wait 1000
    0AF9: samp say_msg "hello"
    wait 1000
    0AF9: samp say_msg "bye"
    wait 1000
    0AF9: samp say_msg "121"
    wait 1000
    Actor.Health($PLAYER_ACTOR) = 0
    wait 4000
end
0AC9: 0@
0AC9: 2@
end







:keyPress
if 0AA2: 2@ = load_library "User32.dll"
then
     if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
     then
         0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
         wait 1@
         0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
     end
end
0AB2: ret 0
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
1@ == 0 for activing
and 1@ == 1 for deactivate?  :me_gusta:

i think the code is all written wrong with 1@ parts
i would fix it but i'm very busy
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
Code:
{$CLEO .cs}
0000: NOP
wait 1000
1@ = 0

while true
wait 0     
   if and
   0AB0:   key_pressed  57
   1@ == 0
   then
   wait 200
   1@ = 1
   0AD1: show_formatted_text_highpriority "~G~ACTIVATED" time 500
   else
      if and
      0AB0:   key_pressed  57
      1@ == 1
      then
      wait 200
      1@ = 0
      0AD1: show_formatted_text_highpriority "~R~DEACTIVATED" time 500
      end
   end
if and 
1@ == 1
8AB0: 57
    then
    wait 5000
    0AB1: call @keyPress 2 key 16 time 500
    wait 1000
    0AF9: samp say_msg "hello"
    wait 1000
    0AF9: samp say_msg "bye"
    wait 1000
    0AF9: samp say_msg "121"
    wait 1000
    Actor.Health($PLAYER_ACTOR) = 0
    wait 4000
end
end

:keyPress
if 0AA2: 2@ = load_library "User32.dll"
then
     if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
     then
         0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
         wait 1@
         0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
     end
end
0AB2: ret 0
 

m1zg4rd_PL

Well-known member
Joined
Jul 19, 2013
Messages
222
Reaction score
0
hasin1 link said:
Thanks Springfield, but unfortunately the script still doesn't get deactivated

This code should work, but because of using long "wait" functions, you have to hold key for some seconds to deactivate it

Code:
{$CLEO .cs}
0000: NOP
wait 1000
1@ = 0

:Main
  wait 0     
  if and
    key_down 57
    1@ == 0
  then
    jump @Activation
  end
  
  if and
    key_down 57
    1@ == 1
  then
    0AD1: show_formatted_text_highpriority "~R~DEACTIVATED" time 500
    jump @Deactivation
  end
  
  if
    1@ == 1
  then
    wait 5000
    0AB1: call @keyPress 2 key 16 time 500
    wait 1000
    0AF9: samp say_msg "hello"
    wait 1000
    0AF9: samp say_msg "bye"
    wait 1000
    0AF9: samp say_msg "121"
    wait 1000
    Actor.Health($PLAYER_ACTOR) = 0
    wait 4000
  end
jump @Main

:Activation
wait 10
if
  not key_down 57
else_jump @Activation
  wait 200     
  1@ = 1
  0AD1: show_formatted_text_highpriority "~G~ACTIVATED" time 500
jump @Main

:Deactivation
wait 10
if
  not key_down 57
else_jump @Deactivation
  wait 200     
  1@ = 0
jump @Main

:keyPress
if 0AA2: 2@ = load_library "User32.dll"
then
     if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
     then
         0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
         wait 1@
         0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
     end
end
0AB2: ret 0

In this version you can deactivate it anytime because I added counter variable:

Code:
{$CLEO .cs}
0000: NOP
wait 1000
1@ = 0

:Main
  wait 20     
  if and
    key_down 57
    1@ == 0
  then
    3@ = 0
    jump @Activation
  end
  
  if and
    key_down 57
    1@ == 1
  then
    3@ = 0
    0AD1: show_formatted_text_highpriority "~R~DEACTIVATED" time 500
    jump @Deactivation
  end
  
  if
    1@ == 1
  then
    3@ += 1  //counter increase by 1 every 20 miliseconds, so 50 passes = 1 second
    if
      3@ == 250
    then
      0AB1: call @keyPress 2 key 16 time 500
    end

    if
      3@ == 300
    then
      0AF9: samp say_msg "hello"
    end

    if
      3@ == 350
    then
      0AF9: samp say_msg "bye"
    end

    if
      3@ == 400
    then
      0AF9: samp say_msg "121"
    end
    
    if
      3@ == 450
    then
      Actor.Health($PLAYER_ACTOR) = 0
    end
    
    if
      3@ == 650
    then
      3@ = 0
    end
  end
jump @Main

:Activation
wait 10
if
  not key_down 57
else_jump @Activation
  wait 200     
  1@ = 1
  0AD1: show_formatted_text_highpriority "~G~ACTIVATED" time 500
jump @Main

:Deactivation
wait 10
if
  not key_down 57
else_jump @Deactivation
  wait 200     
  1@ = 0
jump @Main

:keyPress
if 0AA2: 2@ = load_library "User32.dll"
then
     if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
     then
         0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
         wait 1@
         0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
     end
end
0AB2: ret 0
 
Status
Not open for further replies.
Top