ChampaRando
Active member
Hey guys, I'm a fairly knowledged Java/JavaScript/Python programmer but again, very new to CLEO.
So, I play in a RP server (HZRP, easy) and I am thinking of implementing a CLEO that autolocks my car (maybe type CMD in /pvl) automatically if I start to drive it and it is unlocked. I know exactly the logical steps to implement it but not sure in SAMP with the OPCodes and whatever. Here is what Im thinking, lemme know if each step is possible or not, and if so, how/which OPCODE can I use to implement it? Cheers. Willing to share this script with public as well after / if I make it work.
So, best way I think is if CLEO can detect if a car is LOCKED (I am aware a car lock may be a server-sided thing but seriously it has SOME GTA SA client local logic because if a car is locked, our player cant enter at all. Its like how cars are locked in GTA SA story mode? I'm thinking best way could be, as soon as I hit my F/Return key (we can maybe hard-program if key pressed), script checks if nearby vehicle is locked or not. If locked; send CMD /pvl (to unlock), if unlocked, leave it as is.
I also wanna implement some cooler features, if they're possible or not; For example, if I am driving a car, and I leave the car (so maybe CLEO can know that im currently driving, then if I exit my vehicle, it again quickly checks if its locked or not, if locked, do nothing, else if unlocked, lock the vehicle just as I leave).
Last feature im thinking about is auto-lock. For example, once I enter a car, and script unlocks it for me prior to entering, after say for example 10 seconds of being INSIDE the CAR (so can CLEO do a timer/count, with IsPlayerInVehicle or some OPCODE, this is what im not sure of), then if in car for longer than 10 seconds, send /pvl to autolock vehicle?
What do you guys think? I know the logic behind it, not sure of how to implement as I dont know any APIs for CLEO.
Thanks.
So, I play in a RP server (HZRP, easy) and I am thinking of implementing a CLEO that autolocks my car (maybe type CMD in /pvl) automatically if I start to drive it and it is unlocked. I know exactly the logical steps to implement it but not sure in SAMP with the OPCodes and whatever. Here is what Im thinking, lemme know if each step is possible or not, and if so, how/which OPCODE can I use to implement it? Cheers. Willing to share this script with public as well after / if I make it work.
So, best way I think is if CLEO can detect if a car is LOCKED (I am aware a car lock may be a server-sided thing but seriously it has SOME GTA SA client local logic because if a car is locked, our player cant enter at all. Its like how cars are locked in GTA SA story mode? I'm thinking best way could be, as soon as I hit my F/Return key (we can maybe hard-program if key pressed), script checks if nearby vehicle is locked or not. If locked; send CMD /pvl (to unlock), if unlocked, leave it as is.
I also wanna implement some cooler features, if they're possible or not; For example, if I am driving a car, and I leave the car (so maybe CLEO can know that im currently driving, then if I exit my vehicle, it again quickly checks if its locked or not, if locked, do nothing, else if unlocked, lock the vehicle just as I leave).
Last feature im thinking about is auto-lock. For example, once I enter a car, and script unlocks it for me prior to entering, after say for example 10 seconds of being INSIDE the CAR (so can CLEO do a timer/count, with IsPlayerInVehicle or some OPCODE, this is what im not sure of), then if in car for longer than 10 seconds, send /pvl to autolock vehicle?
What do you guys think? I know the logic behind it, not sure of how to implement as I dont know any APIs for CLEO.
Thanks.