[Release][1.0] Call Services System

vdk_call

Resources for FiveM DEVELOPERS allowing them to to integrate a call system for services (police, emergency, taxi, …)

Installation

Usage for DEVELOPERS

  • Populate the inService and callActive variables like you want
  • Use “player:serviceOn” and “player:serviceOff” events with the name of the job taken when player take is service
  • Use “call:makeCall” event with the name of the service to trigger a call

Notes

The template.lua file show you how to use it :wink:

17 Likes

Seems light & simple. Very nice! :grinning:

1 Like

Great! Just what we been waiting for!

2 Likes

Thanks VodK :slight_smile: Goin to test this :slight_smile:

1 Like

How to make a call?
If you are French, you can explain it to me in mp?

  -- Trigger a call of Uber with F9
        if IsControlJustPressed(1, 56) then
            local plyPos = GetEntityCoords(GetPlayerPed(-1), true)
            TriggerServerEvent("call:makeCall", "uber", {x=plyPos.x,y=plyPos.y,z=plyPos.z})
        end

Change uber with the job you want (you also need to configure it in server.lua at the beginning of the file)
You can also create a menu and set up on a button the TriggerServerEvent ^^

1 Like

In serveur.lua

local inService = {
[“police”] = {},
[“medic”] = {},
[“taxi”] = {},
}
local callActive = {
[“police”] = {taken = false},
[“medic”] = {taken = false},
[“taxi”] = {taken = false},

In call.lua

local working

Citizen.CreateThread(function()
while true do
Citizen.Wait(1)

    if IsControlJustPressed(1, 38) then
        if not working then
            TriggerServerEvent("player:serviceOn", "taxi")
        else
            TriggerServerEvent("player:serviceOff", "taxi")
        end
        working = not working
    end
    -- Trigger a call of Uber with F9
    if IsControlJustPressed(1, 56) then
        local plyPos = GetEntityCoords(GetPlayerPed(-1), true)
        TriggerServerEvent("call:makeCall", "taxi", {x=plyPos.x,y=plyPos.y,z=plyPos.z})
    end
end

end)

??

ty for shar :slight_smile:

no need to add -vdk_call in citmp-server.yml ?

Simple intergration. Very nice!

1 Like

It is necessary to put the name (Example: Taxi) of the Job-system?

1 Like

Hello,
is it possible to give us/upload an example of the server.lua and the call.lua with all the fields modified for a job like “taxi” for example? we tried to change a lot of things and nothing seems to work properly :confused: , anyway thanks for sharing!

1 Like

Look m’y template file, you don’t need server side script for use this script

Hey VDK it’s couga from N3MTV, i hink we need you can you go to Teamspeak :smiley:

1 Like

Hello VodK.
Even with the template you give, it’s hard to understand for a beginner in LUA. Spent a couple of hours trying to get this work :slight_smile:

Could you please make us a better explanation on how to add a script call with your release ?
(Maybe Make a taxi call for example, where the job name is taxi ? )

Think that everybody, me first, would be thankfull for this.

Thanks :wink:

6 Likes

Hi VDK thank you for the work provided while i watched your release for 2 days and i still can not get it to work when i press F9 actually a call is running though i can not manage to add a player ‘’ In Service ‘’ Eventually if a french is in the corner to replicate me I’m at your disposal Thank you

You put the name that you want, my script is not linked with jib-system at all :wink:

When I press F9 everyone except Police receives the call

Please VodK, explain us much more how to use it :slight_smile: Make us a full example please :slight_smile:

I don’t know how I can be more explicit than the template.lua file… If you create a taxi job : you call TriggerServerEvent("player:serviceOn", "taxi") when he takes is service and TriggerServerEvent("player:serviceOff", "taxi") when he stop it… And for civil you call :

local plyPos = GetEntityCoords(GetPlayerPed(-1), true)
TriggerServerEvent("call:makeCall", "taxi", {x=plyPos.x,y=plyPos.y,z=plyPos.z})

when you want to call a taxi in service… Now you have integrate my script in yours that’s why I said FOR DEVELOPERS in description…

1 Like

You made a mistake in your police script I think