37 lines
1.1 KiB
Lua
37 lines
1.1 KiB
Lua
RegisterNetEvent('esx_addons_gcphone:call')
|
|
AddEventHandler('esx_addons_gcphone:call', function(data)
|
|
local playerPed = GetPlayerPed(-1)
|
|
local coords = GetEntityCoords(playerPed)
|
|
local message = data.message
|
|
local number = data.number
|
|
if message == nil then
|
|
DisplayOnscreenKeyboard(1, "FMMC_MPM_NA", "", "", "", "", "", 200)
|
|
while (UpdateOnscreenKeyboard() == 0) do
|
|
DisableAllControlActions(0);
|
|
Wait(0);
|
|
end
|
|
if (GetOnscreenKeyboardResult()) then
|
|
message = GetOnscreenKeyboardResult()
|
|
end
|
|
end
|
|
if message ~= nil and message ~= "" then
|
|
TriggerServerEvent('esx_addons_gcphone:startCall', number, message, {
|
|
x = coords.x,
|
|
y = coords.y,
|
|
z = coords.z
|
|
})
|
|
end
|
|
end)
|
|
|
|
RegisterNetEvent('esx_addons_gcphone:call_taxi')
|
|
AddEventHandler('esx_addons_gcphone:call_taxi', function(data)
|
|
local playerPed = GetPlayerPed(-1)
|
|
local coords = GetEntityCoords(playerPed)
|
|
TriggerServerEvent('esx_phone:send', '555-5555', "Eine Person benötigt ein Taxi", false, {
|
|
x = coords.x,
|
|
y = coords.y,
|
|
z = coords.z
|
|
})
|
|
TriggerServerEvent("taxijob:server:request")
|
|
end)
|