-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.lua
56 lines (44 loc) · 1.67 KB
/
client.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
ESX = exports["es_extended"]:getSharedObject()
Citizen.Wait(0)
end
end)
RegisterCommand("support", function(source, args, rawCommand)
local message = ''
for i=1, #args, 1 do
message = message .. ' ' .. args[i]
end
local playerPed = PlayerPedId()
local playerLocation = GetEntityCoords(playerPed)
TriggerServerEvent('Support:callSupport', message, playerLocation)
end)
RegisterNetEvent('Support:showSupport')
AddEventHandler('Support:showSupport', function(playername, playerid, message, playerLocation)
ESX.ShowNotification('~r~Supportfall!\n~y~' .. playername .. '~s~(~y~' .. playerid .. '~s~) benötigt Hilfe. \nNachricht: ~b~' .. message)
local blip = AddBlipForCoord(playerLocation.x, playerLocation.y)
SetBlipSprite(blip, 280)
SetBlipScale(blip, 1.0)
SetBlipColour(blip, 0)
BeginTextCommandSetBlipName("STRING");
AddTextComponentString('Supportfall')
EndTextCommandSetBlipName(blip)
local time = 0
while time < 800 do
time = time + 1
showInfobar('Drücke ~g~F10~s~, um dich zu ~y~' .. playername .. ' ~s~zu teleportieren.')
if IsControlJustPressed(0, 57) then
SetEntityCoords(PlayerPedId(), playerLocation.x, playerLocation.y, playerLocation.z + 1.0)
time = 800
RemoveBlip(blip)
end
Citizen.Wait(1)
end
end)
function showInfobar(msg)
CurrentActionMsg = msg
SetTextComponentFormat('String')
AddTextComponentString(CurrentActionMsg)
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end