From a587387a0ac61de9d944069e4c79ee28830d9fc9 Mon Sep 17 00:00:00 2001 From: Valentin Funk Date: Fri, 27 Oct 2017 06:47:35 +0200 Subject: [PATCH] fix(pts_fixer): Points fixer commands can only be run via rcon/server console --- .../server/{pts_fixer.lua => sv_pts_fixer.lua} | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) rename lua/ps2/server/{pts_fixer.lua => sv_pts_fixer.lua} (92%) diff --git a/lua/ps2/server/pts_fixer.lua b/lua/ps2/server/sv_pts_fixer.lua similarity index 92% rename from lua/ps2/server/pts_fixer.lua rename to lua/ps2/server/sv_pts_fixer.lua index d4fe7945..9fa4dabb 100644 --- a/lua/ps2/server/pts_fixer.lua +++ b/lua/ps2/server/sv_pts_fixer.lua @@ -1,4 +1,9 @@ -local function fixPts() +local function fixPts(ply, cmd, args) + if IsValid(ply) then + ply:ChatPrint("Please run this command via rcon/server console") + return + end + if not Pointshop2 or not Pointshop2.DB or not Pointshop2.DB.ConnectionPromise then MsgC(Color(255, 0, 0), "ERROR: Pointshop2 is not loaded yet. Please rerun.") return @@ -38,6 +43,11 @@ end concommand.Add("ps2_fixpoints", fixPts) local function setPointsGlobal(ply, cmd, args) + if IsValid(ply) then + ply:ChatPrint("Please run this command via rcon/server console") + return + end + if not Pointshop2 or not Pointshop2.DB or not Pointshop2.DB.ConnectionPromise then MsgC(Color(255, 0, 0), "ERROR: Pointshop2 is not loaded yet. Please rerun.") return @@ -76,6 +86,11 @@ concommand.Add("ps2_setwallet_all", setPointsGlobal) local function updatePoints(ply, cmd, args) + if IsValid(ply) then + ply:ChatPrint("Please run this command via rcon/server console") + return + end + if not Pointshop2 or not Pointshop2.DB or not Pointshop2.DB.ConnectionPromise then MsgC(Color(255, 0, 0), "ERROR: Pointshop2 is not loaded yet. Please rerun.") return