-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.lua
77 lines (76 loc) · 5.16 KB
/
server.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- VARIÁVEIS LOCAIS
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local Tunnel = module("vrp", "lib/Tunnel")
local Proxy = module("vrp", "lib/Proxy")
vRP = Proxy.getInterface("vRP")
vRPclient = Tunnel.getInterface("vRP")
sorry = {}
Tunnel.bindInterface("paramedico",sorry)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ATIVADO QUANDO PRESSIONA E
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RegisterServerEvent('Paramedico:Emprego')
AddEventHandler('Paramedico:Emprego', function()
local source = source
local user_id = vRP.getUserId(source)
local player = vRP.getUserSource(user_id)
if vRP.hasPermission(user_id,"Equipar.Paramedico") then
TriggerClientEvent('Paramedico:Equipar', source)
vRP.giveInventoryItem(user_id,"kit medico",25,true) -- 10 É IGUAL A QUANTIDADE DE KIT QUE IRÁ PARA O INVENTARIO
else
TriggerClientEvent("pNotify:SendNotification", user_id, {
text = "Você não é um paramedico",
type = "error",progressBar = false,timeout = 3000,layout = "sorry",queue = "left",
animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}
})
end
end)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ATIVADO QUANDO PRESSIONA Y
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RegisterServerEvent('Paramedico:ForaEmprego')
AddEventHandler('Paramedico:ForaEmprego', function()
local source = source
local user_id = vRP.getUserId(source)
local player = vRP.getUserSource(user_id)
if vRP.hasPermission(user_id,"Equipar.Paramedico") then
TriggerClientEvent('Paramedico:Sair', source)
else
TriggerClientEvent("pNotify:SendNotification", user_id, {
text = "Você não é um paramedico",
type = "error",progressBar = false,timeout = 3000,layout = "sorry",queue = "left",
animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}
})
end
end)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- MENSAGEM QUE ENTROU EM SERVIÇO
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RegisterServerEvent('Mensagem:DentroSamu')
AddEventHandler('Mensagem:DentroSamu', function()
local source = source
local user_id = vRP.getUserId(source)
local identity = vRP.getUserIdentity(tonumber(user_id))
TriggerClientEvent('chatMessage', -1, 'SAMU', {255, 0, 0},"O paramedico ^1".. identity.firstname .. " " .. identity.name .. " ^7iniciou seu expediente.")
TriggerClientEvent("pNotify:SendNotification", user_id, {
text = "Você bateu o ponto, vá trabalhar",
type = "success",progressBar = false,timeout = 3000,layout = "sorry",queue = "left",
animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}
})
end)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- MENSAGEM QUE SAIU DE SERVIÇO
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RegisterServerEvent('Mensagem:ForaSamu')
AddEventHandler('Mensagem:ForaSamu', function()
local source = source
local user_id = vRP.getUserId(source)
local identity = vRP.getUserIdentity(tonumber(user_id))
TriggerClientEvent('chatMessage', -1, 'SAMU', {255, 0, 0},"O paramedico ^1".. identity.firstname .. " " .. identity.name .. " ^7terminou seu expediente.")
TriggerClientEvent("pNotify:SendNotification", user_id, {
text = "Você finalizou seu expediente",
type = "success",progressBar = false,timeout = 3000,layout = "sorry",queue = "left",
animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}
})
end)