-
Notifications
You must be signed in to change notification settings - Fork 151
/
server.lua
133 lines (120 loc) · 5.58 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
return {
updateInterval = 5, -- how often to update player data in minutes
money = {
---@alias MoneyType 'cash' | 'bank' | 'crypto'
---@alias Money {cash: number, bank: number, crypto: number}
---@type Money
moneyTypes = { cash = 500, bank = 5000, crypto = 0 }, -- type = startamount - Add or remove money types for your server (for ex. blackmoney = 0), remember once added it will not be removed from the database!
dontAllowMinus = { 'cash', 'crypto' }, -- Money that is not allowed going in minus
paycheckTimeout = 10, -- The time in minutes that it will give the paycheck
paycheckSociety = false -- If true paycheck will come from the society account that the player is employed at
},
player = {
hungerRate = 4.2, -- Rate at which hunger goes down.
thirstRate = 3.8, -- Rate at which thirst goes down.
---@enum BloodType
bloodTypes = {
'A+', 'A-', 'B+', 'B-', 'AB+', 'AB-', 'O+', 'O-',
},
---@alias UniqueIdType 'citizenid' | 'AccountNumber' | 'PhoneNumber' | 'FingerId' | 'WalletId' | 'SerialNumber'
---@type table<UniqueIdType, {valueFunction: function}>
identifierTypes = {
citizenid = {
valueFunction = function()
return lib.string.random('A.......')
end,
},
AccountNumber = {
valueFunction = function()
return 'US0' .. math.random(1, 9) .. 'QBX' .. math.random(1111, 9999) .. math.random(1111, 9999) .. math.random(11, 99)
end,
},
PhoneNumber = {
valueFunction = function()
return math.random(100,999) .. math.random(1000000,9999999)
end,
},
FingerId = {
valueFunction = function()
return lib.string.random('...............')
end,
},
WalletId = {
valueFunction = function()
return 'QB-' .. math.random(11111111, 99999999)
end,
},
SerialNumber = {
valueFunction = function()
return math.random(11111111, 99999999)
end,
},
}
},
---@alias TableName string
---@alias ColumnName string
---@type [TableName, ColumnName][]
characterDataTables = {
{'properties', 'owner'},
{'bank_accounts_new', 'id'},
{'playerskins', 'citizenid'},
{'player_mails', 'citizenid'},
{'player_outfits', 'citizenid'},
{'player_vehicles', 'citizenid'},
{'player_groups', 'citizenid'},
{'players', 'citizenid'},
{'npwd_calls', 'identifier'},
{'npwd_darkchat_channel_members', 'user_identifier'},
{'npwd_marketplace_listings', 'identifier'},
{'npwd_messages_participants', 'participant'},
{'npwd_notes', 'identifier'},
{'npwd_phone_contacts', 'identifier'},
{'npwd_phone_gallery', 'identifier'},
{'npwd_twitter_profiles', 'identifier'},
{'npwd_match_profiles', 'identifier'},
}, -- Rows to be deleted when the character is deleted
server = {
pvp = true, -- Enable or disable pvp on the server (Ability to shoot other players)
closed = false, -- Set server closed (no one can join except people with ace permission 'qbadmin.join')
closedReason = 'Server Closed', -- Reason message to display when people can't join the server
whitelist = false, -- Enable or disable whitelist on the server
whitelistPermission = 'admin', -- Permission that's able to enter the server when the whitelist is on
discord = '', -- Discord invite link
checkDuplicateLicense = true, -- Check for duplicate rockstar license on join
---@deprecated use cfg ACE system instead
permissions = { 'god', 'admin', 'mod' }, -- Add as many groups as you want here after creating them in your server.cfg
},
characters = {
playersNumberOfCharacters = { -- Define maximum amount of player characters by rockstar license (you can find this license in your server's database in the player table)
['license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'] = 5,
},
defaultNumberOfCharacters = 3, -- Define maximum amount of default characters (maximum 3 characters defined by default)
},
-- this configuration is for core events only. putting other webhooks here will have no effect
logging = {
webhook = {
['default'] = nil, -- default
['joinleave'] = nil, -- default
['ooc'] = nil, -- default
['anticheat'] = nil, -- default
['playermoney'] = nil, -- default
},
role = {} -- Role to tag for high priority logs. Roles use <@%roleid> and users/channels are <@userid/channelid>
},
giveVehicleKeys = function(src, plate, vehicle)
return exports.qbx_vehiclekeys:GiveKeys(src, vehicle)
end,
getSocietyAccount = function(accountName)
return exports['Renewed-Banking']:getAccountMoney(accountName)
end,
removeSocietyMoney = function(accountName, payment)
return exports['Renewed-Banking']:removeAccountMoney(accountName, payment)
end,
---Paycheck function
---@param player Player Player object
---@param payment number Payment amount
sendPaycheck = function (player, payment)
player.Functions.AddMoney('bank', payment)
Notify(player.PlayerData.source, locale('info.received_paycheck', payment))
end,
}