CLEO Help Cleo activation deactivation

CLEO related
Status
Not open for further replies.

Bombspike

New member
Joined
Aug 30, 2016
Messages
4
Reaction score
0
First of all sorry for my bad English, i'm a spanish speaker.

I want to add an activation/deactivation method for these cleos
the first cleo locks de the camera behind the car but only when I hold down "C".
What I want is a key to keep the camera locked behind and another to unlock it.

Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 

:NONAME_2
wait 0 
if and
   Actor.Driving($PLAYER_ACTOR)
0AB0:   key_pressed 67 
else_jump @NONAME_2 
Camera.SetBehindPlayer
jump @NONAME_2

The second cleo is for the camera too, this cleo disables the movement of the camera.
I don´t know how to explain it, here is a video
https://www.youtube.com/watch?v=bb85a53ZkLw
This cleo is always activated, I want the same, a key for disable the movement and another for return to normality.


Code:
{$CLEO .cs}
0000:


WHILE TRUE
    WAIT 0
    IF
    Actor.Driving($PLAYER_ACTOR)
    THEN
        0AB1: @MouseMOVE_DOWN 0
        WAIT 400
        0AB1: @MouseMOVE_UP 0        
    END
END
0661: NOP "www.ugbase.eu and www.youtube.com/OpcodeXe"

0661: NOP "1337 code wow so hard to make xD"




:MouseMOVE_RIGHT
0AA2: 31@ = load_library "user32.dll"
0AA4: 30@ = get_proc_address "mouse_event" library 31@
IF
0A4C:   mouse_not_inverted_vertically
THEN
    0AA5: call 30@ num_params 5 pop 0 0 0 0 -1 0
ELSE
    0AA5: call 30@ num_params 5 pop 0 0 0 0  1 0
END
0AA3: free_library 31@
0AB2: 0

:MouseMOVE_LEFT
0AA2: 31@ = load_library "user32.dll"
0AA4: 30@ = get_proc_address "mouse_event" library 31@
IF
0A4C:   mouse_not_inverted_vertically
THEN
    0AA5: call 30@ num_params 5 pop 0 0 0 0 2 0
ELSE
    0AA5: call 30@ num_params 5 pop 0 0 0 0 -2 0
END
0AA3: free_library 31@
0AB2: 0

:MouseMOVE_DOWN
0AA2: 31@ = load_library "user32.dll"
0AA4: 30@ = get_proc_address "mouse_event" library 31@
0AA5: call 30@ num_params 5 pop 0 0 0 -1 0 0
0AA3: free_library 31@
0AB2: 0

:MouseMOVE_UP
0AA2: 31@ = load_library "user32.dll"
0AA4: 30@ = get_proc_address "mouse_event" library 31@
0AA5: call 30@ num_params 5 pop 0 0 0 1 0 0
0AA3: free_library 31@
0AB2: 0
 
Please help me, I don't understand coding, I try but i can't
Thank you people!
 

PlasticBottle

Active member
Joined
Jul 13, 2016
Messages
162
Reaction score
1
For enabling/disabling you need this opcode:
0B12: 0@ = 0@ XOR 1
It takes the variable "0@" and returns a value of 0/1 everytime you use it (false/true)
Here's how it's done:

if
0ADC: test_cheat "SPACECAKE" //check if user types "SPACECAKE"
then
0B12: 0@ = 0@ XOR 1 //so everytime user types "SPACECAKE", the 0@ variable is either gonna return 0 or 1.
if
0@ == 1 //check if var is true
then
//stuff when enabled
else //when var is false
//stuff when disabled
end
end

@TehArgis explained it to me
 
Status
Not open for further replies.
Top