-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.lua
68 lines (59 loc) · 1.84 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
-------------------------
--- NDBankRobbery ---
-------------------------
NDCore = exports["ND_Core"]:GetCoreObject()
RegisterNetEvent("GiveRewardBank")
AddEventHandler("GiveRewardBank", function(player)
local player = source
NDCore.Functions.AddMoney(20000, player, "cash")
end)
RegisterNetEvent("GiveRewardAmmo")
AddEventHandler("GiveRewardAmmo", function(player)
local player = source
NDCore.Functions.AddMoney(500, player, "cash")
end)
RegisterNetEvent("GiveRewardLTD")
AddEventHandler("GiveRewardLTD", function(player)
local player = source
NDCore.Functions.AddMoney(5000, player, "cash")
end)
RegisterNetEvent("GiveReward247")
AddEventHandler("GiveReward247", function(player)
local player = source
NDCore.Functions.AddMoney(5000, player, "cash")
end)
RegisterNetEvent("GiveRewardLiq")
AddEventHandler("GiveRewardLiq", function(player)
local player = source
NDCore.Functions.AddMoney(5000, player, "cash")
end)
--- Server ---
robberyActive = false
RegisterNetEvent('NDBankRobbery:IsActive')
AddEventHandler('NDBankRobbery:IsActive', function()
-- Check if active or not
if robberyActive then
-- One is active
TriggerClientEvent('NDBankRobbery:IsActive:Return', source, true)
else
-- One is not active
TriggerClientEvent('NDBankRobbery:IsActive:Return', source, false)
end
end)
RegisterNetEvent('NDBankRobbery:SetActive')
AddEventHandler('NDBankRobbery:SetActive', function(bool)
robberyActive = bool
if bool then
Wait((1000 * 60 * config.robberyCooldown)) -- Wait 15 minutes
robberyActive = false
end
end)
RegisterNetEvent('Print:PrintDebug')
AddEventHandler('Print:PrintDebug', function(msg)
print(msg)
TriggerClientEvent('chatMessage', -1, "^7[^1Badger's Scripts^7] ^1DEBUG ^7" .. msg)
end)
RegisterNetEvent('PrintBR:PrintMessage')
AddEventHandler('PrintBR:PrintMessage', function(msg)
TriggerClientEvent('chatMessage', -1, msg)
end)