mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-19 14:56:02 +01:00
fix(server/commands): return if player not found.
This commit is contained in:
@@ -84,6 +84,8 @@ lib.addCommand("setjob", {
|
|||||||
}
|
}
|
||||||
}, function(source, args, raw)
|
}, function(source, args, raw)
|
||||||
local player = NDCore.getPlayer(args.target)
|
local player = NDCore.getPlayer(args.target)
|
||||||
|
if not player then return end
|
||||||
|
|
||||||
local job = args.job:lower()
|
local job = args.job:lower()
|
||||||
local jobInfo = player.setJob(job, args.rank)
|
local jobInfo = player.setJob(job, args.rank)
|
||||||
if not player or not jobInfo then return end
|
if not player or not jobInfo then return end
|
||||||
@@ -210,6 +212,7 @@ lib.addCommand("pay", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
local player = NDCore.getPlayer(source)
|
local player = NDCore.getPlayer(source)
|
||||||
|
if not player then return end
|
||||||
local success = player.deductMoney("cash", args.amount)
|
local success = player.deductMoney("cash", args.amount)
|
||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
|
|||||||
Reference in New Issue
Block a user