- added timeout function. any event you trigger puts a 3 second hold on the rest of the script for that player to ensure no injectors can endlessly spam and get things. if triggered while on cooldown a console print happens
This commit is contained in:
1 parent
af0efacfe9
commit
d9fcb11930
17 files changed
+83
-58
No files matched your search
@@ -20,16 +20,20 @@ local CrackLocations = {
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
ps.registerCallback('md-drugs:server:GetCrackLocations', function()
|
||||
return CrackLocations
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:makecrackone', function(num)
|
||||
local src = source
|
||||
local tier = 'tier1'
|
||||
if timeOut(src, 'md-drugs:server:makecrackone') then return end
|
||||
if not ps.checkDistance(src, CrackLocations.makecrack[num].loc, 2.0) then
|
||||
ps.notify(src, ps.lang('Catches.notIn'), 'error')
|
||||
return
|
||||
end
|
||||
|
||||
if Config.TierSystem then
|
||||
local crackTiers = {
|
||||
{item = 'loosecoke', tier = 'tier1'},
|
||||
@@ -53,6 +57,7 @@ end)
|
||||
RegisterServerEvent('md-drugs:server:bagcrack', function(num)
|
||||
local src = source
|
||||
local tier = 'tier1'
|
||||
if timeOut(src, 'md-drugs:server:bagcrack') then return end
|
||||
if not ps.checkDistance(src, CrackLocations.bagcrack[num].loc, 2.0) then
|
||||
ps.notify(src, ps.lang('Catches.notIn'), 'error')
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user