CLEO Help How to make this Script only work when player actor standing at nearest vehicle?

CLEO related
Status
Not open for further replies.

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
Did you guys know how to make this Script only work when player actor standing at nearest vehicle? Help me..

Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
thread "EasyLockVehicle"

:EasyLockVehicle_19
wait 50
if
key_down 97
else_jump @EasyLockVehicle_19
wait 100
say "/pvlock"
jump @EasyLockVehicle_19
 
Last edited:

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
thread "EasyLockVehicle"

:EasyLockVehicle_19
wait 50
if and
056E:   car 0@ defined
0256:   player 1@ defined   
else_jump @EasyLockVehicle_19
if and
key_down 88
key_down 49             
if
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
else_jump @EasyLockVehicle_19
wait 100
say "/pvlock"
jump @EasyLockVehicle_19

is it correct?
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
Code:
:main
wait 0
if 0A32:   is_char_attached_to_any_car $PLAYER_ACTOR
then   
if
key_down 113
jf @main
wait 100
say "/pvlock"
end
jump @main

Like that?
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
yes … but instead of low code use

high code

Code:
while true
    wait 0
    if 0A32:   is_char_attached_to_any_car $PLAYER_ACTOR
    then
        if key_down 113
        then
            wait 100
            say "/pvlock"
        end
    end
end
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
doesn't work. i've tried standing near vehicle and press the hotkey doesn't work. i've tried enter the car and press the hotkey it doesn't work too.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
what is /pvlock command doing? Does it have to be used once after jumping on the car? In such case you could automatically detect when you begin surfing using something like this:

Code:
0@ = false

:main
wait 0

if 0A32:   is_char_attached_to_any_car $PLAYER_ACTOR
then
    if 0@ == false
    then
    say "/pvlock"
    end
    0@ = true
else
0@ = false
end

jump @main
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
then nothing I posted is applicable xD
there's a snippet to get nearest car in the snippet section as far as I remember (because that opcode to get nearest car crashes the game if the closest car is too far away)
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
what is /pvlock command doing? Does it have to be used once after jumping on the car? In such case you could automatically detect when you begin surfing using something like this:

Code:
0@ = false

:main
wait 0

if 0A32:   is_char_attached_to_any_car $PLAYER_ACTOR
then
    if 0@ == false
    then
    say "/pvlock"
    end
    0@ = true
else
0@ = false
end

jump @main

/pvlock command for unlock/lock vehicle at Roleplay servers. should be able to use many times "F12" to "/pvlock". if use "end" at the code, it will be cannot use again in the next two times i think.
 
Status
Not open for further replies.
Top