I am thinking of maybe upgrading it in the future so it supports more than one.
Right now I have to think about it mostly because vRP doesn’t allow check if user has X item but only try to give, so it would be quite a mess.
Hey, first off love this script i am getting ready to add it to my community’s server but there is one thing missing and that is for a chance to send a police alert on a rejection. I am very new to coding so i probably did everything wrong but i tried for a day or two now to add an alert on a rejection and nothing i tired worked i was wondering if you or someone reading this would be kind enough to help me figure this out
ok in the original script it has this code that triggers a police alert on a 1 in 3 chance. it looks like this:
local randomReport = math.random(1, 3)
if randomReport == 2 then
local plyPos = GetEntityCoords(GetPlayerPed(-1), true)
local s1, s2 = Citizen.InvokeNative( 0x2EB41072B4C1E4C0, plyPos.x, plyPos.y, plyPos.z, Citizen.PointerValueInt(), Citizen.PointerValueInt() )
local street1 = GetStreetNameFromHashKey(s1)
local street2 = GetStreetNameFromHashKey(s2)
TriggerServerEvent(‘dispatch’, “drug”, street1, plyPos.x, plyPos.y, plyPos.z)
end
obviously that is not written for vRP so that code is worthless to us but i tried a few different ways to do something similar for vRP to make it do something similar to when players steal cars, basicly adding wanted level and polce get the blue star on the map but everything i tried failed.
Like i said i am brand new to coding i have maybe been doing this for a week so i probably did something wrong everytime i tried cause i barely know what i am doing.
this little feature is a huge deal for an RP server like it adds an element of risk to selling drugs and i am really hoping you guys can help me get this added not only for me but for others who use this script as well
every time i try to use vRP to do it crashes the script and doesn’t give an error so i have no idea what is going wrong i was really hoping maybe you or someone else here knew how to make it work
If you press F8 in your console while in game you can see what error it gives.
Most likely you have something wrong, upload your client.lua to pastebin and send here the link.
i added this after line 63, i didn’t change anything else in the script. it is based off of the vRP/modules/police.lua for vehicle tracking. i attempted to do something similar for the way alerts on stealing cars works but i had already deleted that edit
i was unable to figure this out, i assume this is because of my severe lack of coding knowledge, if anyone does figure this out can you please share it with me
Works great until I get a ped that rejects the attempt. At that point the script crashes.
Psycho Edit. Only changes I made were item to “weed” and amount of dirty money to (200, 600)
Error resuming caourtine: citizen:/scripting/lua/scheduler: No such export SetQueMax in resource pNotify stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler in metamethod ‘__index’
cliient.lua:53: in function client.lua:24
The way it works on LSL is that, if you attempt to sell drugs to an NPC.
They have the chance to send an automatic sms to the online player police with your location.
So if your sale fails, it triggers the police and they may come investigate.
That what he was probably trying to explain to you