mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:01:22 +00:00
refactor(es_extended/server/classes/player): add error msg for invalid functions
This commit is contained in:
@@ -951,6 +951,10 @@ local function runStaticPlayerMethod(src, method, ...)
|
||||
return
|
||||
end
|
||||
|
||||
if not ESX.IsFunctionReference(xPlayer[method]) then
|
||||
error(("Attempted to call invalid method on playerId %s: %s"):format(src, method))
|
||||
end
|
||||
|
||||
return xPlayer[method](...)
|
||||
end
|
||||
exports("RunStaticPlayerMethod", runStaticPlayerMethod)
|
||||
Reference in New Issue
Block a user