add get_guid() function to fake player

This commit is contained in:
OgelGames
2025-11-01 00:33:31 +11:00
parent b565ca2c40
commit 71d8234040

View File

@@ -82,6 +82,10 @@ local function check_vector(v)
end end
end end
local function new_fake_guid()
return string.format("@fakeplayer%d%d", os.time(), math.random(100, 999))
end
-- Dynamic get/set functions -- Dynamic get/set functions
---------------------------------------- ----------------------------------------
@@ -89,6 +93,13 @@ function fake_player:get_player_name()
return self.data.name or "" return self.data.name or ""
end end
function fake_player:get_guid()
if not self.data.guid then
self.data.guid = new_fake_guid()
end
return self.data.guid
end
function fake_player:get_inventory() function fake_player:get_inventory()
if not self.data.inventory then if not self.data.inventory then
self.data.inventory = fakelib.create_inventory({ self.data.inventory = fakelib.create_inventory({