CLEO Help Lock Z axis

CLEO related
Status
Not open for further replies.

veysileth

Active member
Joined
Mar 23, 2017
Messages
85
Reaction score
6
I'm trying to write a script which will lock Z(up/down) axis when flying a helicopter.
But really there's no opcode for this. Every velocity, set_car opcode is using XYZ. And i want only to lock Z while moving on XY like always.

Anyone ever met with something like that? Or any clues where should i start?
 

veysileth

Active member
Joined
Mar 23, 2017
Messages
85
Reaction score
6
Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 
0@ = 0 

:NONAME_9
8AFA:   not is_samp_available 
004D: jump_if_false @NONAME_30 
0001: wait 400 ms 
0002: jump @NONAME_9 

:NONAME_30
0001: wait 1000 ms 
0B34: samp register_client_command "hy" to_label @hy
0B34: samp register_client_command "hy2" to_label @hy2


:Yup
0001: wait 0 ms
00D6: if and
0256: player $PLAYER_CHAR defined
0039: 0@ == 1
004D: jump_if_false @Yup
03C0: 1@ = actor $PLAYER_ACTOR car
00D6: if
056E:   car 1@ defined
004D: jump_if_false @Yup
0AF8: samp add_message_to_chat "DONE" color -1
00AA: store_car 1@ position_to 2@ 3@ 5@
00AB: put_car 1@ at 2@ 3@ 4@
0002: jump @Yup


:hy
0001: wait 0 ms
03C0: 1@ = actor $PLAYER_ACTOR car
00AA: store_car 1@ position_to 2@ 3@ 4@
0@ = 1
0AF8: samp add_message_to_chat "SHOULD BE 1" color -1
0B43: samp cmd_ret

:hy2
0001: wait 0 ms
0@ = 0
0AF8: samp add_message_to_chat "SHOULD BE 0" color -1
0B43: samp cmd_ret


emm [font=Monaco, Consolas, Courier, monospace]00AA: store_car 1@ position_to 2@ 3@ 5@[/font] ofc will freeze it.

07D5: set_car 0@ velocity_in_direction_XYZ 9@ 10@ 0.0 rotation_velocitiesXY 0.0 0.0 unk 0.0 will push car forever in XYZ direction. Weird shit happens. Helicopter is flying all over the sky.

idk maybe there's opcode for pushing veh in one direction, but i haven't found it yet. If i only could force opcode to ignore first two values.
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
{$CLEO .cs}
0000:


REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY



WHILE TRUE
WAIT 0
if
04A9: actor 395@(253@,16i) driving_heli
then
0@ = current car
GetPos 0@ 1@ 2@ 3@
GetPos 0@ 4@ 5@ 6@
6@ = 40.0 // height u want to stay at
3@- 6@
setCarvleocity 0. 0.0 3@




end
END
 

veysileth

Active member
Joined
Mar 23, 2017
Messages
85
Reaction score
6
setCarvleocity 0. 0.0 3@

<.< AnimeXe you drunk


0AB: set_car_velocity 0@ to 0.0 0.0 3@
This? I just need this opcode in normal/useful mode plox
 
Status
Not open for further replies.
Top