Jump to content

RagePluginHook Cruise Control Problem


K0Stek

Recommended Posts

Hi, Posting First Time,  sorry if it's in the wrong thread.

 

i started Programming WIth RPH Api For 2 Days, i already had Common Knowledge about programming so it was easy to start for me.

however i run into a Logical Problem, i tried to Create A Simple Cruise Control Plugin, i started and i went on pretty good. i've done Getting Player's Current Speed, I've Done Increasing, Decreasing Speed. But I am stuck at actually Increasing Speed Of A Car To Currently Set Cruise Control, i don' t know how to make car speed up and slow down, i already tried a couple of things.

 

Things I Tried:
- I Tried To Do Game.LocalPlayer.Character.ApplyForce()

- I Tried Sending KeyDown using SendKey.KeyUp()

- I Tried DllImporting keybd_event.

- I Tried Using NuGet Package InputSimulator

 

Everytime I Tried Keybd_event or InputSimulator, Character in Game Would Just Freak Out.

 

Any Help Would Be Greatly Appreciated

 

P.S English is Not My Primary Langauge So Excuse Me If I Made Some Mistakes

Link to comment
Share on other sites

  • Management Team

The easiest way would be to apply the driving task with a specific speed to the player ped. This will also make the player drive (i.e. turn etc.) too, though. You can directly set the speed of the car using the Game.LocalPlayer.Character.CurrentVehicle.Velocity property. This is the physical speed of the car, not its actual speed on the road.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...