diff --git a/lua/noclip_store/core/sv_store.lua b/lua/noclip_store/core/sv_store.lua index 379fea3..f0c80cb 100644 --- a/lua/noclip_store/core/sv_store.lua +++ b/lua/noclip_store/core/sv_store.lua @@ -44,7 +44,7 @@ function NoClip.Store.Core.EventProcess(data) continue end - typeFunc(receiver, expired, v) + typeFunc(receiver, expired, v, data) end hook.Run("NoClipStorePostEventProcess", data.id, receiver, data) diff --git a/lua/noclip_store/core/types/command.lua b/lua/noclip_store/core/types/command.lua index 261460d..3f807f1 100644 --- a/lua/noclip_store/core/types/command.lua +++ b/lua/noclip_store/core/types/command.lua @@ -1,11 +1,12 @@ -- Custom Console Command -NoClip.Store.Core.RegisterType("custom_console_command", function(ply, expired, data) +NoClip.Store.Core.RegisterType("custom_console_command", function(ply, expired, data, eventData) local command = expired and (data.data.console_command_expire or "") or data.data.console_command if (not command) or (command == "") then return end command = string.Replace(command, "{player.name}", "\""..string.Replace(ply:Name(), "\"", "").."\"") command = string.Replace(command, "{player.steamID}", ply:SteamID()) command = string.Replace(command, "{player.steamID64}", ply:SteamID64()) + command = string.Replace(command, "{purchase.amount}", eventData.purchase_amount) game.ConsoleCommand(command.."\n") end) \ No newline at end of file diff --git a/lua/noclip_store/core/types/lua.lua b/lua/noclip_store/core/types/lua.lua index 208757b..66099f8 100644 --- a/lua/noclip_store/core/types/lua.lua +++ b/lua/noclip_store/core/types/lua.lua @@ -1,5 +1,5 @@ -- Custom Lua Action -NoClip.Store.Core.RegisterType("custom_lua", function(ply, expired, data) +NoClip.Store.Core.RegisterType("custom_lua", function(ply, expired, data, eventData) NoClip.Store.TempPlayer = ply -- This seems like the easiest and most reliable way to pass an object. local code = expired and (data.data.custom_lua_expire or "") or data.data.custom_lua @@ -8,6 +8,8 @@ NoClip.Store.Core.RegisterType("custom_lua", function(ply, expired, data) code = string.Replace(code, "{player.entity}", "NoClip.Store.TempPlayer") code = string.Replace(code, "{player.steamID}", "\""..ply:SteamID().."\"") code = string.Replace(code, "{player.steamID64}", "\""..ply:SteamID64().."\"") + code = string.Replace(code, "{player.name}", "\""..string.Replace(ply:Name(), "\"", "").."\"") + code = string.Replace(code, "{purchase.amount}", eventData.purchase_amount) local errorMsg = RunString(code, "NoClipStoreCustomLuaAction", false) if errorMsg then