[RELEASE] Pepper Spray

Just trigger the event :slight_smile:

Add a new label:
{label = (‘pepperspray’), value = ‘pepperspray’}

add a new action:

if action == ‘pepperspray’ then
TriggerEvent(“pepperspray:Togglepepperspray”)

1 Like

does anyone know how to fix it so that you don’t hit someone when you spray it?

how to make it Onesync ready

Hello, I wanted to know why when I gaze a player, he receives no effect? thank you

Anyway to make this OneSync compatible? Everything with it works except the effect, other players dont get pepper sprayed

Any news on OneSync compatibility?

where do I put this?

Yo, depends on where you actually want it. And sorry for the late reply, been of fivem for quite some time.

If someone still needs this for example the police menu, then open client.lua in policejob, find the labes.
For example
{label = (‘cuff’), value = ‘cuff’}
Copy that line, make a new one under it.
Then go down to all the actions.
For example
if action == ‘cuff’ then
blablablalba
Copy the if action == ‘cuff’ line and make a new one under the “blablabla” code.
Like:
if action == ‘cuff’ then
blablabla
end
if action == ‘pepperspray’ then
TriggerEvent(“pepperspray:Togglepepperspray”)
end

All done.

hi very cool mod but can you add so we can use it on online players ingame?

Does anyone have a working version of this with the effects

Yeah would be good if this was an item not a command & would be even better if it had effects because at its current state its just a useless prop lol :slight_smile:

Will there be an OneSync compatible update?

Any chance that this will be OneSync compatible.

Is there any way for a keyboard example: Caps Lock, and only police job can active it

In order to make it OneSync compatible just up the GetPlayerFromPed(ped) function loop to 128.

Example:

function GetPlayerFromPed(ped)
	for a = 0, 128 do
		if GetPlayerPed(a) == ped then
			return a
		end
	end
	return -1
end

Remove the register commands from the server.lua

Then add the following to client.lua

RegisterCommand('pepperspray', function(source)
    TriggerEvent("pepperspray:Togglepepperspray", source)
end, false)
RegisterKeyMapping('pepperspray', 'Description', 'keyboard', 'KEYBIND')
1 Like

Thanks alot, is there anyway I use a Meth System and my Meth system use the same sparkles so… yeah? Is there an way to do this on the slot BZ Gas?

Nice script!! you should make as a item

Is there an way to have this job locked? only police job can do /pepperspray

Should be easy, initalize ESX serversided, then add a simple check if the xPlayer has the police job. Should be pretty easy to do, if you struggle you could check in another script and look at that code.