distritic / mdt

A police Mobile Data Terminal system designed for use on the FiveM platform. Made for phynix.gg.
https://forum.cfx.re/t/1701472
31 stars 86 forks source link

Call's Issue #14

Closed SharkMcNugget closed 3 years ago

SharkMcNugget commented 3 years ago

I attempted to get calls working and I got it to work with one of the replies on the forums on how to do it, But I am having an issue where it is displaying everything in the user’s table for the caller. Any idea on how to fix this?

Mrs-BzZz commented 3 years ago

gcphone/server/server.lua

RegisterServerEvent('gcPhone:sendMessage')
AddEventHandler('gcPhone:sendMessage', function(phoneNumber, message)
    local sourcePlayer = tonumber(source)
    local identifier = getPlayerID(source)
    addMessage(sourcePlayer, identifier, phoneNumber, message)

    ---------------MDT POLICE-----------
    local ItWasHuman = GetPlayerPed(sourcePlayer)
    local IseeHim = GetEntityCoords(ItWasHuman)
    local JesusChrist = ESX.GetPlayerFromId(sourcePlayer)
    local OMG = JesusChrist.getName(sourcePlayer)

    if phoneNumber == 'police' then
    TriggerEvent("mdt:newCall", message, OMG, vector3(IseeHim.x, IseeHim.y, IseeHim.z))
end 
end)
distritic commented 3 years ago

This isn't an issue with the MDT itself but your code, all documentation is clear on the Cfx.re thread.