mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-17 06:16:02 +01:00
Hopefully fix the error when charging
I think if you had alot of players, it would overload itself and slip in a nil value when checking for player info This checks if it is a real source number being sent and also adds a slightly delay to help load easier
This commit is contained in:
@@ -21,8 +21,11 @@ registerCommand("cashregister", {
|
||||
createCallback(getScript()..":MakePlayerList", function(source)
|
||||
local onlineList = {}
|
||||
for _, v in pairs(GetPlayers()) do
|
||||
local Player = getPlayer(v)
|
||||
onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..Player.name }
|
||||
if v ~= nil or type(v) ~= "number" then
|
||||
local Player = getPlayer(v)
|
||||
onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..Player.name }
|
||||
Wait(10)
|
||||
end
|
||||
end
|
||||
return onlineList
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user