[Release] [vRP] Sell drugs to NPC

Shouldn’t work when that tired. I do have pNotify, but I had it commented out because I had been trying to resolve a different conflict. My bad. Works awesome now

exactly but instead of sending an sms it would add wanted level to the player so that it pings a police alert for. so far i still can’t find a way to make that function work, its more then a little frustrating.

You can use de service alert from vrp to send a call to all polices, and put a blip in the map (default is a blue star).

In client.lua line 63 add:

local randomReport = math.random(1, 3)
if randomReport == 2 then
  local plyPos = GetEntityCoords(GetPlayerPed(-1))
  TriggerServerEvent('vRP_drugNPC:policia',plyPos.x, plyPos.y, plyPos.z)
end

in server.lua add:

RegisterServerEvent('vRP_drugNPC:policia')
AddEventHandler('vRP_drugNPC:policia', function(x,y,z)
     vRP.sendServiceAlert({nil, "Policía",x,y,z,"Este señor me está ofreciendome droga para comprarle"})
end)

“Policía” its de name of your call police service, you can see it in vrp/cfg/phone.lua, and you can translate de mensaje “Este señor me está ofreciendome droga para comprarle”.

2 Likes

Do you mind if I add this to the Github?
More ease for everyone to use it.

No problem , if you have any problem send me mp

Did you test this? Or is this untested?

Trust me, it will work.
Once I get some spare time I’ll upload to github.

I got it if you want me to send to you: already added to the files

Submit a push request on Github.

How would i change if from money to dirty money?
Also how do i add multiple things we could sell to the npc’s, with diffrend prices?

Sorry im new, please explain it to me, i really wanna learn Heh

We got the script to work but it no one buys everyone rejects, the random report to police is working fine. can anyone help? thanks in advance

just change the random math stuff

1 Like

DO you have a working file so I can copy it?

no mine i made for esx

This has been reverted to a previous state, link has been updated.

locals reject 10/10 times, can sell the drug

That works! Some buy, some refuse, some report to cops and cops get 911 call with gps! Whats the discord thing for though and how do I set it? Worked fine without

Using dunko and MySQL async on zap if that helps. Discord in configure file?

You’ll have to ask the guy I linked since he’s the one that is using that.
I just added the link for him: https://forum.cfx.re/u/darkcomichero/

Discord is optional. You will still get PD service alerts either way. … Basically for the discord portion if you want to use it, you will want to set up webhook in your Discord first. Good tutorial here, very simple to do, then update the config.lua with your webhook. After, whenever there is a police service call for this script it will send a TTS (text to speech) message to that Discord channel. The way our community uses is a single channel for many of these send to discord pieces in various scripts. Bankrobbery, a panic button for LEO, etc. When the alert comes through Discord it speaks it aloud so that the LEO kind of have a hands free environment. Like a robot dispatcher that gives them the alert along with the cross streets and area.

3 Likes