-
Notifications
You must be signed in to change notification settings - Fork 0
/
forklift_sv.lua
66 lines (58 loc) · 1.91 KB
/
forklift_sv.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
local hangar1ID = nil
local hangar2ID = nil
local gotowka = {a = 100, b = 200} -- zakres od ile do ile wynosi gotowka za wykonanie misji
-----------------------------------
local MisjaAktywna = 0
AddEventHandler('playerDropped', function(DropReason)
if hangar1ID == source then
hangar1ID = nil
end
if hangar2ID == source then
hangar2ID = nil
end
end)
RegisterServerEvent('tostdostawa:przejmijHangar')
AddEventHandler('tostdostawa:przejmijHangar', function(ktory)
if ktory == '1' then
if hangar1ID == nil then
hangar1ID = source
TriggerClientEvent(Notify, source, 'You are taking over the hangar.')
TriggerClientEvent(Notify, source, 'Now only you can perform orders here.')
TriggerClientEvent("tostdostawa:maszHangar", source)
else
TriggerClientEvent(Notify, source, 'This hangar is already taken by ID '..hangar1ID)
end
elseif ktory == '2' then
if hangar2ID == nil then
hangar2ID = source
TriggerClientEvent(Notify, source, 'You are taking over the hangar.')
TriggerClientEvent(Notify, source, 'Now only you can perform orders here.')
TriggerClientEvent("tostdostawa:maszHangar", source)
else
TriggerClientEvent(Notify, source, 'This hangar is already taken by ID '..hangar2ID)
end
end
end)
RegisterServerEvent('tostdostawa:wykonanieMisji')
AddEventHandler('tostdostawa:wykonanieMisji', function(premia)
local _source = source
local Player = Framework.Functions.GetPlayer(source)
local LosujSiano = math.random(gotowka.a,gotowka.b)
if premia == 'nie' then
Player.Functions.AddMoney("cash", LosujSiano)
TriggerClientEvent(Notify, _source, 'You get $'..LosujSiano..' for delivery')
Wait(2500)
else
Player.Functions.AddMoney("cash", premia)
Wait(2500)
end
end)
RegisterServerEvent('tostdostawa:OdszedlDalekoo')
AddEventHandler('tostdostawa:OdszedlDalekoo', function()
if hangar1ID == source then
hangar1ID = nil
end
if hangar2ID == source then
hangar2ID = nil
end
end)