how to convert 0ADC: test_cheat to 0AB0: key_pressed

Alienware

Member
Joined
Jun 4, 2024
Messages
7
Reaction score
1
here is the part of the script that i want to change the activate/desactivate key to F11, when i change 0ADC: test_cheat "CARDL" to 0AB0: key_pressed 122
it works but it keeps flooding while i'm pressing F11 key, i have to quickly press a lot of times for it to activate or desactivate, i would like to press and i changes without flood.



1@ = 0

while true
wait 0
if 0ADC: test_cheat "CARDL"
then
if 1@ == 0
then
0ACD: show_text_highpriority "Car-HP On." time 1337
018C: play_sound 1083 at 0.0 0.0 0.0
1@ = 1
else
0ACD: show_text_highpriority "Car-HP Off." time 1337
018C: play_sound 1084 at 0.0 0.0 0.0
1@ = 0
0A92: create_custom_thread "Car-HP Indicator.cs"
end_thread
end
end
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,163
Solutions
5
Reaction score
894
Location
Lithuania
PHP:
while true
wait 0

if 0AB0: 123 // F12
then
    if 1@ == 0
    then
        0ACD: show_text_highpriority "Car-HP On." time 1337
        018C: play_sound 1083 at 0.0 0.0 0.0
        1@ = 1
    else
        0ACD: show_text_highpriority "Car-HP Off." time 1337
        018C: play_sound 1084 at 0.0 0.0 0.0
        1@ = 0
        0A92: create_custom_thread "Car-HP Indicator.cs"
        end_thread
    end
end

end
 

Alienware

Member
Joined
Jun 4, 2024
Messages
7
Reaction score
1
PHP:
while true
wait 0

if 0AB0: 123 // F12
then
    if 1@ == 0
    then
        0ACD: show_text_highpriority "Car-HP On." time 1337
        018C: play_sound 1083 at 0.0 0.0 0.0
        1@ = 1
    else
        0ACD: show_text_highpriority "Car-HP Off." time 1337
        018C: play_sound 1084 at 0.0 0.0 0.0
        1@ = 0
        0A92: create_custom_thread "Car-HP Indicator.cs"
        end_thread
    end
end

end
still flooding man, when i presse F12 it keeps alternating between on and off very fast, sometimes it stops "ON" sometimes it stops "OFF"
 

Alienware

Member
Joined
Jun 4, 2024
Messages
7
Reaction score
1
here is the full script:
{$CLEO}
{$USE ini}
0662: NOP "########################"
0662: NOP "Made by Monstercat"
0662: NOP "_____www.ugbase.eu______"
0662: NOP "########################"
0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED445' 0@ //// Get gxt text address by gxt name
0AA5: call 0x718600 2 pop 2 0@ "~1~"

1@ = 1

while true
wait 0
if
0AB0: key_pressed 122
then
if 1@ == 0
then
0ACD: show_text_highpriority "Car-HP On." time 1337
018C: play_sound 1083 at 0.0 0.0 0.0
1@ = 1
else
0ACD: show_text_highpriority "Car-HP Off." time 1337
018C: play_sound 1084 at 0.0 0.0 0.0
1@ = 0
end
end

if 1@ == 1
then
00A0: store_actor $PLAYER_ACTOR position_to 22@ 23@ 24@
0AF2: 0@ = get_float_from_ini_file "cleo\Car-HP Indicator.ini" section "SETTINGS" key "Distance"
if 0AE2: 31@ = random_vehicle_near_point 22@ 23@ 24@ in_radius 0@ find_next false pass_wrecked 0 // Thx MISTER_GONWIK <3
then
gosub @draw_text
while 0AE2: 31@ = random_vehicle_near_point 22@ 23@ 24@ in_radius 0@ find_next true pass_wrecked 0
gosub @draw_text
end
end
end
end

:draw_text
// Car - 31@
if 80DB: not actor $PLAYER_ACTOR in_car 31@
then
00AA: store_car 31@ position_to 2@ 3@ 4@

0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 2@ Y 3@ Z 4@ store_screen_X_to 6@ Y_to 7@
if and
00C2: sphere_onscreen 2@ 3@ 4@ radius 0.0
6@ >= 0.0
6@ <= 640.0
7@ >= 0.0
7@ <= 448.0
then
0227: 5@ = car 31@ health

03F0: enable_text_draw 1
0342: set_text_draw_centered 1
03E0: draw_text_behind_textures 0
033F: set_text_draw_letter_size width 0.20 height 0.80
081C: draw_text_outline 1 RGBA 0 0 0 255
0340: set_text_draw_RGBA 0 255 0 255
045A: draw_text_1number 6@ 7@ GXT 'CRED445' number 5@ //
end
end
return

:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@
 

Ice555

Member
Joined
Mar 11, 2021
Messages
21
Solutions
1
Reaction score
3
Location
Lithuania
If key_down 1
Then
Repeat
Wait 0
Until 8ab0: 1
Printf "key pressed 1 time" time 1000
End
 

Alienware

Member
Joined
Jun 4, 2024
Messages
7
Reaction score
1
where do i paste it in the scrip?
i'm using sanny builder 3, in the "if key_down 1" sanny builder 3 gives me error "unknown directive key_down 1" whitch compiler do you recommend and in whitch part of the script do i paste this part that you send me?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,163
Solutions
5
Reaction score
894
Location
Lithuania
i'm using sanny builder 3, in the "if key_down 1" sanny builder 3 gives me error "unknown directive key_down 1" whitch compiler do you recommend and in whitch part of the script do i paste this part that you send me?
Replace word " key_down"
With " 0AB0: "
 

Alienware

Member
Joined
Jun 4, 2024
Messages
7
Reaction score
1
sorry i don't know where to paste this part:

PHP:
If
0AB0: key_down 122
Then
Repeat
Wait 0
Until
8ab0: 122
Print "key pressed 122 time" time 1000
End

in this script:

PHP:
while true
wait 0

if 0AB0: 122 // F11
then
    if 1@ == 0
    then
        0ACD: show_text_highpriority "Car-HP On." time 1337
        018C: play_sound 1083 at 0.0 0.0 0.0
        1@ = 1
    else
        0ACD: show_text_highpriority "Car-HP Off." time 1337
        018C: play_sound 1084 at 0.0 0.0 0.0
        1@ = 0
        0A92: create_custom_thread "Car-HP Indicator.cs"
        end_thread
    end
end
 

Ice555

Member
Joined
Mar 11, 2021
Messages
21
Solutions
1
Reaction score
3
Location
Lithuania
Code:
while true
wait 0

if 0AB0: 122 // F11
then
    repeat
    wait 0
    until 8ab0: 122
    if 1@ == 0
    then
        0ACD: show_text_highpriority "Car-HP On." time 1337
        018C: play_sound 1083 at 0.0 0.0 0.0
        1@ = 1
    else
        0ACD: show_text_highpriority "Car-HP Off." time 1337
        018C: play_sound 1084 at 0.0 0.0 0.0
        1@ = 0
        0A92: create_custom_thread "Car-HP Indicator.cs"
        end_thread
    end
end
 

Alienware

Member
Joined
Jun 4, 2024
Messages
7
Reaction score
1
Code:
while true
wait 0

if 0AB0: 122 // F11
then
    repeat
    wait 0
    until 8ab0: 122
    if 1@ == 0
    then
        0ACD: show_text_highpriority "Car-HP On." time 1337
        018C: play_sound 1083 at 0.0 0.0 0.0
        1@ = 1
    else
        0ACD: show_text_highpriority "Car-HP Off." time 1337
        018C: play_sound 1084 at 0.0 0.0 0.0
        1@ = 0
        0A92: create_custom_thread "Car-HP Indicator.cs"
        end_thread
    end
end
Thank you, it just works fine.
 
Top