cleo help, IF other player in car then etc.

BruvBruv

Member
Joined
Apr 26, 2019
Messages
12
Reaction score
4
Sup guys,
I need some help coding a hack. I want to know with what code the cleo does specific actions if a car is occupied by another player and NOT ME ( OTHER player is in a car, not me). If the car is not occupied (by another player, not me) it repeats with jf @ etc.

should look something like this

IF AND
car 0@ defined
"Other.player.is.in.car @0"
THEN
...

cant share the cleo because of reason y know

ALSO: does it require sampfuncs to know if a car is occupied by another player? id like the hack not to require sampfuncs if thats possible

help is very much appreciated
 
Last edited:

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
there's probably a better way but meh

Code:
{$CLEO .cs}
0B34: samp register_client_command "check" to_label @check


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

while true
wait 0
end

:check
0B35: samp 0@ = get_last_command_params
0C1A: 1@ = atoi 0@
0B20: samp 2@ = actor_handle_by_samp_player_id 1@
03C0: 3@ = actor 2@ car
if 056E:   car 3@ defined
then
    0B2C: samp 4@ = get_vehicle_id_by_car_handle 3@
    if 4@ == -1
        then
            0AF8: samp add_message_to_chat "you aren't in car %d" color -1 4@
        else
            0AF8: samp add_message_to_chat "you are in car %d" color -1 4@
    end
end 

0B43: samp cmd_ret
 

BruvBruv

Member
Joined
Apr 26, 2019
Messages
12
Reaction score
4
there's probably a better way but meh

Code:
{$CLEO .cs}
0B34: samp register_client_command "check" to_label @check


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

while true
wait 0
end

:check
0B35: samp 0@ = get_last_command_params
0C1A: 1@ = atoi 0@
0B20: samp 2@ = actor_handle_by_samp_player_id 1@
03C0: 3@ = actor 2@ car
if 056E:   car 3@ defined
then
    0B2C: samp 4@ = get_vehicle_id_by_car_handle 3@
    if 4@ == -1
        then
            0AF8: samp add_message_to_chat "you aren't in car %d" color -1 4@
        else
            0AF8: samp add_message_to_chat "you are in car %d" color -1 4@
    end
end

0B43: samp cmd_ret

This will require sampfuncs to work properly, as far as I know. Is there also a way to check if an other player is in the car without thr cleo requiring sampfuncs?
Thanks anyway
 

Ayamabi

Active member
Joined
Mar 8, 2018
Messages
169
Reaction score
111
This will require sampfuncs to work properly, as far as I know. Is there also a way to check if an other player is in the car without thr cleo requiring sampfuncs?
Thanks anyway

yes ma man u need addresses and shet
@Opcode.eXe
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
You can but i'm not going to do it because im lazy asf and there's no sense when you have sampfuncs, you have all structs here tho so it should be easy to do it if you want:
https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.h#L626
I'm not sure if you can use sVehicleID from stRemotePlayerData or you have to do stRemotePlayerData->stInCarData->sVehicleID, probably both work tho.
All of this assuming you have to check the vehicle id of a player to know if he is in a car, there's probably a better way xd
 

BruvBruv

Member
Joined
Apr 26, 2019
Messages
12
Reaction score
4
You can but i'm not going to do it because im lazy asf and there's no sense when you have sampfuncs, you have all structs here tho so it should be easy to do it if you want:
https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.h#L626
I'm not sure if you can use sVehicleID from stRemotePlayerData or you have to do stRemotePlayerData->stInCarData->sVehicleID, probably both work tho.
All of this assuming you have to check the vehicle id of a player to know if he is in a car, there's probably a better way xd

i dont want to use sampfuncs to do it becuase id like to keep the cleo working in 0.3.dl. Anyway, thanks for your help
 
Top