I’m using vRP and making police GPS with blips. I only want the cops to have blips and the cops to see each others blips.
but they aren’t working. Here’s what I’ve got:
__resource.lua
client_script 'client.lua'
server_script 'server.lua'
client.lua
RegisterNetEvent('displayblip')
AddEventHandler('displayblip', function(x, y, z)
local ped = GetPlayerPed(-1)
local x,y,z = table.unpack(GetEntityCoords(ped, false))
local blip1 = AddBlipForCoord(x, y, z)
local user_id = vRP.getUserId(source)
local plyPos = GetEntityCoords(GetPlayerPed(-1), true)
Citizen.Wait(0)
if user_id ~= nil and vRP.hasPermission(user_id,"police.paycheck") then
Citizen.Wait(0)
vRP.openMenu(source,menu_pc)
SetBlipSprite(blip1, 1)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString('Police GPS')
SetBlipColour(blip1, 1)
TriggerServerEvent('activateblip', plyPos.x, plyPos.y, plyPos.z)
elseif user_id ~= nil and (ped ~= vRP.hasPermission(user_id,"police.paycheck")) then
-- MAKE BLIPS INVISABLE
end
end)
server.lua:
TriggerClientEvent("displayblip", source)
RegisterServerEvent('activateblip')
AddEventHandler('activateblip', function(mx, my, mz)
TriggerClientEvent('displayblip', -1, mx, my, mz)
end)
Any ideas?
Also is this line correct to check if the ped doesn’t have the permission, if so how do you make a blips opacity 1?
elseif user_id ~= nil and (ped ~= vRP.hasPermission(user_id,"police.paycheck")) then
-- MAKE BLIPS INVISABLE
end
Kind Regards,
Catraz