Jump to content

Ending callout when car gets picked up by tow truck


xMG

Recommended Posts

Hey there, I'm learning to mod on LSPDFR and wanted to make my own callouts plugin. I wanted to know how would I go about ending a callout when a car is being towed away.  (For example I'm using StopThePed towing). Probably something easy that I'm missing.

regularperson.png

Link to comment
Share on other sites

  • Management Team

There are two separate problems really: 1) detecting if a c ar is being towed and b) ending the callout. Do you know what car you want to check? I have no idea of how StopThePed works, so you would have to look into how it does the towing a bit to figure out the best way on how to detect it. Ending your callout is as easy as calling End.

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

  • Management Team

You could see if it is attached to the other car using natives, then you could check if it is attached to any entity.

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

You could use the "IsOnAllWheels()" method on the vehicle to be towed and check its condition in a loop.  Not sure if this will return false when the vehicle is teleported, or when it's on a flatbed.

Edited by Rich

Released plugins

Automatic Siren Cutout | Rich's Police EnhancementsScene Manager | Rich Ambiance

Retired - No more updates

Link to comment
Share on other sites

When I tell you I sat here at 4am scrolling through the methods....I must've looked through all of them at least 20 times and I still missed the "IsOnAllWheels()" one. Anyways. It works perfectly, works on flatbeds aswell. Only problem is since the vehicle spawns slightly above ground the callout ends automatically before you arrive. An easy fix for that was to just do

Game.LocalPlayer.Character.DistanceTo(Car.Position) < 5f

and then start checking if vehicle is on all wheels

 

Thanks for the help @Rich and I predicted the future by saying "Probably something easy that I'm missing." 😁

Edited by xMG

regularperson.png

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...