[REQUEST] Stinger/Spike Script?

roleplay
police
stinger

#1

Hello, I was wondering if there is any type of script that when the player types “/st” or “/stinger” in chat a spike strip would spawn in-front of them? Meaning when they are doing a pursuit they can pop the cars tires? Thanks, Hope to hear back soon.

Regards
CrazyCorrs


#2

Well It seems like it would be possible but not without some issues.

To start with, the Stinger model doesn’t automatically call the function that allows it to actually pop tires when its spawned.
That usually only happens when its spawned in a mission or by the AI Cops.

The issue is not to make the Spike Strip (Stingers) spawn but rather make them actually do anything other than just exist.

I personally have been trying to figure out how to do this and i haven’t had any luck outside of maybe something that checks the area around the model of the spikes and looks for the closest vehicle and pops its tires.

If anyone does have an idea of how to make this work please do enlighten us.


#3

Maybe this could help.


#4

How does this work? @grahamgarn


#5

Not sure. Found it while searching through github. It may or may not work, but it could help with development of the script.


#6

Could indeed, I have already looked at this and I was going to attempt it but I know nothing about scripting.


#7

Nice find! @grahamgarn I compiled the Source you posted and it works 100% (as far as I can tell)

No idea if I could release the binary version though. I will try and contact the author and if he gives me permission I will post a compiled copy in this thread.

Edit: Just checked again and It’s under the MIT license.

I will attach the binary compiled directly from the source.


#8

Okay! Compiled.

Attached is a zip containing the compiled DLL. Just load it as a resource on your server and it should work flawlessly.Spike Strips V for FiveM.zip (12.8 KB)

Oh, Almost forgot! So to use the spikes

Hold E and press 2 to drop
Hold E and press 1 to pick them back up.

This is the Section of this post where I will cover my ass:

Source code:

Not sure if Virustotal scans are needed.

EDIT: heres the virus total scans of the DLL files regardless

https://www.virustotal.com/en/file/6270c8bbe71ef3cb64e89ffa0a3b13604ddcb72e626e93d09133335ffb928d85/analysis/1498521674/

https://www.virustotal.com/en/file/2b949a300aaf8d50ea3c692a35c3b245a9737cb92e9d14fe0fe12376de0bbe8d/analysis/1498521676/

One is for the debug version one is for the non debug

UPDATE: This script is currently only working with any vehicle your driving or any AI vehicle. It Does NOT sync the spike strip effect across to other players as of yet unfortunately. ( Ill try to fix this myself as best i can but if someone solves this please let me know)


[Release] Cops FiveM
[Release] Cops FiveM
#9

Wow, amazing share man! Glad something I found was put to use :slight_smile:


#10

Man why does it need scripthook… I CRYYY PLEASE CONVERT! xD


#11

lol. Maybe that’s why its now working for me…


#12

Amazing job. thanks man


#13

It doesn’t. This is a server side plugin. you just throw it onto your server as a resource and its streamed to everyone.


#14

Okay. so apparently this script doesn’t work 100%. further testing has shown that the spikes work on You and any AI vehicle but not other players.

Ill see if i can figure out a solution to this issue on my own. if anyone else figures it out before me feel free to post a fork of the source or release a compiled version.


#15

Okay, this is looking good. Hope you get this working 100% I’ll stay in touch and good luck!


#16

Update: So the script is able to detect other player’s vehicles and track the tires. it just can’t force the vehicles tires to pop as the vehicle is not local to the client who deployed the spikes.

If anyone can figure out a way to solve this and or maybe tell me how i could make a function to call a script on the server side to make a players tires pop or something that would be fantastic.

I’m not exactly sure really where to go from here on this as the Mutliplayer functions in fivem feel very poor in the current state, not to mention the even more sparce documentation on C# for fivem compared to what exists for lua make this feel like a nearly impossible feat.


#17

Hmm, I am not able to help but I do wish you luck in the further future and hope to see this script working soon! Good Luck.


#18

Network ID the vehicle then allow the client script to take ownership of the entity?


#19

Bump anyone got ideas?


#20

Assuming the person who wants to operate the spikes has taken time to go ahead of a pursuit and park, they may also have the time to look at who they’re chasing and get the Player ID. Using this, maybe you could use something like, if player or ped is in vehicle, then pop vehicle tires. I forget what the exact code lines are for that but you should get what I’m saying.