CLEO Help [Solved] Actor.OnVehicle? Specific vehicle check?

CLEO related
Status
Not open for further replies.

Lukahlyo

Member
Joined
Nov 11, 2018
Messages
20
Reaction score
1
Yet again, I'm having trouble. This time I'm genuinely stuck.
I've been looking everywhere but I can't seem to find a directive for a condition. Is there any way for a cleo to judge if a player is driving a car or if it's a passenger?
I thought I'd be able to patch this with the Actor.OnVehicle directive, but when compiling it returns an unknown directive error.

Code:
[...]
:code
wait 0
if or
Actor.Driving($PLAYER_ACTOR)
Actor.OnVehicle($PLAYER_ACTOR)
[...]

Also, I'd love to know if there's any way I can check for a specific SA:MP vehicle ID.
Thanks in advance!
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
CTRL + ALT + 2 open the opcode search menu.
Try to use:

IF
00DF: actor $PLAYER_ACTOR driving // checks if your player is in a car, doesnt matter which seat.
THEN

To know if you're a passenger you can try to use this:
0432: 18@ = get_actor_handle_from_car $TEMPVAR_ACTOR_CAR passenger_seat 0


and to check the samp vehicle id you need SAMPFUNCS opcodes:
0B2C: samp 2@ = get_vehicle_id_by_car_handle 1@
 

Lukahlyo

Member
Joined
Nov 11, 2018
Messages
20
Reaction score
1
CTRL + ALT + 2 open the opcode search menu.
Try to use:

IF
00DF: actor $PLAYER_ACTOR driving // checks if your player is in a car, doesnt matter which seat.
THEN

To know if you're a passenger you can try to use this:
0432: 18@ = get_actor_handle_from_car $TEMPVAR_ACTOR_CAR passenger_seat 0


and to check the samp vehicle id you need SAMPFUNCS opcodes:
0B2C: samp 2@ = get_vehicle_id_by_car_handle 1@
Thank you. Very useful! In the end I'm going with opc 0137 for the car handle.
 
Last edited:
Status
Not open for further replies.
Top