Skip to content

Task's - Location Messages

Client side

This part is the part where an event trigger can be created when a message is triggered or called when entering a location.

1- When you enter a location send message#

lua
Config.Locations = {
    [vector3(1398.11, 3669.86, 33.35)] = {
        message = "#121632*",
        name = 'B***k M****',
        isSended = false
    }
}

You can add a new coordinate and message to the table as follows, you can also change the name of the messenger. isSended = true, if you do, the number will be registered and can be called, but it will not be shown in that laconation, so think of it as a hidden code.

lua
Config.Locations = {
    [vector3(1398.11, 3669.86, 33.35)] = {
        message = "#121632*",
        name = 'B***k M****',
        isSended = false
    },
    [vector3(0, 0, 0)] = { -- coords
        message = "#111111*", -- edit number & name
        name = 'Example Example', -- like this
        isSended = false
    }
}

2- When call a number - trigger#

lua
Config.Numbers = { -- You can add more numbers
    {
        number = '#111631*',
        name = 'B***k M****',
        haveVocal = '../tasks/blackmarket.wav',
        action = function(tinfo)
            Task.BlackMarketLocation(tinfo)
        end
    }...

As you can see, you can create a new table with similar logic to the other table.

typevaluedesc
numberstringThe number at which the code is triggered.
namestringDisplay name.
haveVocalbool - stringif you have an audio file - if not you can set "false"
actionfunctionTriggerable part

How it works?#

1- Create a new number

lua
Config.Numbers = { -- You can add more numbers
    {
        number = '#111631*',
        name = 'B***k M****',
        haveVocal = '../tasks/blackmarket.wav',
        action = function(tinfo)
            Task.BlackMarketLocation(tinfo)
        end
    },
    {
        number = '#111111*', -- display number
        name = 'Example', -- display name
        haveVocal = '../tasks/example.wav', -- have vocal
        action = function(tinfo)
            Task.Example(tinfo) -- trigger
        end
    }
}

2- How it works trigger

Open the tasks/tasks.lua, and go all the way down. Create a new function.

It must have the same name as the trigger you will name above - like "Task.Example"

lua
Task.Example = function(tinfo)
    --- you can adapt your heist open door code or you can s
end

3- If you have vocal

You must enter the search entries as follows and if there is sound, you must set it this way.

lua
Task.Example = function(tinfo)
    UpdateCallInfo(tinfo.number, tinfo.name, 'Calling...') -- Updates call info
    Wait(2000) -- waiting for ringing -- for realistism
    UpdateCallInfo(tinfo.number, tinfo.name, 'In Call') -- Updates call info
    if tinfo.haveVocal then
        Task.Sound(tinfo.haveVocal)  -- you need to use to play sounds
    end
    Wait(10000)
    UpdateCallInfo(tinfo.number, tinfo.name, 'End Call')   -- Updates 
    
    --- YOUR CODE HERE
    exports["example-script"].exampleTrigger()
    TriggerServerEvent("example-script:exampletrigger")
end
valuetypedesc
UpdateCallInfofunctionAllows you to update the call info without which the call cannot be set up and will give an error.
WaitfunctionIt's there to provide realism, you can use it at all if you want. Recommended for use.
Task.SoundfunctionIt is used to play sound.