CLEO Help Need just a little help to fix a script

CLEO related

Hagoromo

Member
Joined
Dec 1, 2021
Messages
10
Reaction score
2
Location
Romania
Hi, i would like to make a very simple script for samp where i just press f3 and it gives the keys of the cars to the other passengers or to the driver, and i would like it to work even if i'm the driver or the passenger
I can't figure it out where i have missed something
:cmd_givekey
WAIT 0
if key_down 114
then
if 8@ == 0
then
8@ = 2
jump @cmd_gk
end
else
if 8@ == 1
then
0000:
else
8@ = 0
end
end

:cmd_gk
0007: 12@ = 10.0
11@ = -1
Actor.StorePos($PLAYER_ACTOR, 27@, 26@, 25@)
FOR 0@ = 0 to 999
IF SAMP.IsPlayerConnected(0@)
THEN
IF 1@ = SAMP.GetActorHandleByPlayerID(0@)
THEN
IF Actor.Driving(1@)
THEN
2@ = Actor.CurrentCar(1@)
046C: 20@ = car 2@ driver
IF 003B: 20@ == 1@
THEN
Actor.StorePos(1@, 30@, 29@, 28@)
050A: 16@ = distance_between_XYZ 27@ 26@ 25@ and_XYZ 30@ 29@ 28@
IF 0025: 16@ > 12@
THEN
16@ = 0
ELSE
0087: 12@ = 16@
0085: 11@ = 0@
END
END
END
END
END
END
IF 0039: 11@ == -1
THEN
0085: 1@ = 1@
ELSE
0AF9: samp say_msg "/givekey %d" 11@
END
SAMP.CmdRet()
Thank you so much!
 
Last edited:

HaroldGnomo

Well-known member
Joined
Jun 20, 2021
Messages
211
Reaction score
59
Location
Sahara Desert
what do you mean by "givekey"? its like, get in a car without be the owner or something like that? tell me what you want to do and ill try do it
 

HaroldGnomo

Well-known member
Joined
Jun 20, 2021
Messages
211
Reaction score
59
Location
Sahara Desert
i tried a lot but i dont find a way to do that, sorry
i think i can try like give to player in car only but i cant exactly give keys to close players if you want that way or i can maybe make server command have less letters like "/gk 2" by when you type that it send the server command instead, looks easier bcuz i still learning cleo and im trying to help people for that
 

Hagoromo

Member
Joined
Dec 1, 2021
Messages
10
Reaction score
2
Location
Romania
It's ok, thank you so much, i know, it's easyer to make it with /gk, btw that's how i tried to make it, to give the keys to the players who are in the car, so if you can help me to make it that way, it would be amazing
 

Hagoromo

Member
Joined
Dec 1, 2021
Messages
10
Reaction score
2
Location
Romania
It's ok, thank you so much, i know, it's easyer to make it with /gk, btw that's how i tried to make it, to give the keys to the players who are in the car, so if you can help me to make it that way, it would be amazing
And i mean that i would like it if you could help me to make it work when i press f3 and it gives the keys to the players who are already in the car
 

HaroldGnomo

Well-known member
Joined
Jun 20, 2021
Messages
211
Reaction score
59
Location
Sahara Desert
Thank you!
test that with a friend, player need be driving your car and you need to be in the passenger seat so you press F3 and the command get activated, im not sure if its really gonna work bcuz i cant test it now, i dont know any server with /givekeys command, i dont have a car either and i dont have no one to test with me
 

Attachments

  • givekeys.cs
    17.5 KB · Views: 4
Top