Hi, i have make a phone with a button "call the police’ after this the player in the job police receive a message with name of the player and a marker for join the caller but doesnt work
SV_PHONE.LUA
RegisterServerEvent('police')
AddEventHandler("police", function(source, user)
Citizen.CreateThread(function()
if LOADOUTS = "police" then -- LOADOUTS is the job in the addon LOADOUTS job..
Wait(3)
DisplayCash(false);
SetNotificationTextEntry("STRING");
AddTextComponentString("^2"..GetPlayerName(source).. ", need a police" ); -- Message sent to Police
SetNotificationMessage("CHAR_CHAT_CALL", "CHAR_CHAT_CALL", true, 1, "Police Request"); -- Title of the request sent to Police
DrawNotification(false, true);
Wait(10000000)
BLIP.destination = AddBlipForChar " idk what is the command for make a blip to the caller " -- generate a blip to the caller
SetBlipSprite(BLIP.destination, 1)
SetBlipColour(BLIP.destination, 2)
SetBlipRoute(BLIP.destination, true)
end
end)
end)
CLIENT.LUA
local police
local medecin
RegisterNUICallback("telephone", function(data, cb)
local action = data.action
local newstate = data.newstate
if action == "police" then
AddEventHandler("police", function (source, user)
drawNotification("~g~A patrol is coming, do not move!") -- Notification sent to the caller
elseif action == "medecin" then
drawNotification("~g~Medic is coming, dont move !")
end
cb("ok")
end)
the client are in RegisterNUICallback…