Cleo Scripting Key Binder/Macro Help

GK26

New member
Joined
Dec 24, 2022
Messages
2
Reaction score
0
Location
Indonesia
I was thinking how to make a keybinder works only if the player are inside vehicle or aircraft like Hydra\Rustler for example,
If i pressed Space Button then LMB button is also Activated\Engaged
just like If\Then\Else kind of situation

Im really new to cleo scripting im gladly if someone can teach me how it works
 

Ice555

Active member
Joined
Mar 11, 2021
Messages
49
Solutions
3
Reaction score
7
Location
Lithuania
Code:
If and
key_down 32
key_down 1
then
    if actor.Driving($PLAYER_ACTOR)
    then
        31@ = actor.CurrentCar($PLAYER_ACTOR)
        30@ = car.Id(31@)
        IF or  // car models
        30@ == 476
        30@ == 520
        then
            // UR CODE
            wait 500 // anti spam
        end
    end
end
didnt really understand what u want. btw sanny data have to be installed or just find opcodes.
 

Ice555

Active member
Joined
Mar 11, 2021
Messages
49
Solutions
3
Reaction score
7
Location
Lithuania
made mistake and cant edit. just change this
31@ = actor.CurrentCar($PLAYER_ACTOR)
IF or // car models
0137: car 31@ model == #RUSTLER
0137: car 31@ model == #HYDRA
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
PHP:
{$CLEO .cs}
0000:

WHILE TRUE
WAIT 0

IF AND
0AB0:   key_pressed 1 // Left mouse button
0AB0:   key_pressed 32 // Spacebar
THEN                        
    IF 0256:   player $PLAYER_CHAR defined
    THEN
        IF 0AB1: @is_actor_in_driver_seat 1 CheckingState TRUE
        THEN
            // https://wiki.multitheftauto.com/wiki/PL/Vehicle_IDs
            IF OR
            00DD:   actor $PLAYER_ACTOR driving_car_with_model 520 // Hydra
            00DD:   actor $PLAYER_ACTOR driving_car_with_model 476 // Rustler
            THEN 0AD1: "~g~You are in ~y~Hydra ~g~or ~y~Rustler" 1000
            ELSE 0AD1: "~r~You are in ~y~Hydra ~r~or ~y~Rustler" 1000       
            END
        END
    END
    WAIT 50
END

END
0A93: terminate_this_custom_script
 

Attachments

  • Script.cs
    19 KB · Views: 5
Top