A tweak of this script (It's a free script don't worry)

Basically someone created a TTT reward system which rewards a play pointshop points when they kill a T as a I or D ect. Well I thought well in this script it gives you negative points if you rdm your buddy, well I was thinking could someone make it link the the rdm manager so that if someone reports them for rdm and clicks forgive they don’t lose points and if they don’t forgive they lose points?

Original code



hook.Add("Initialize", "Points.Initialize", function()
	if !ROLE_INNOCENT then return end
	
	local RolePoints = {
		[ROLE_DETECTIVE] = {
			[ROLE_DETECTIVE] = -30,
			[ROLE_INNOCENT] = -10,
			[ROLE_TRAITOR] = 200
		},
		[ROLE_INNOCENT] = {
			[ROLE_DETECTIVE] = -50,
			[ROLE_INNOCENT] = -20,
			[ROLE_TRAITOR] = 50
		},
		[ROLE_TRAITOR] = {
			[ROLE_DETECTIVE] = 200,
			[ROLE_INNOCENT] = 25,
			[ROLE_TRAITOR] = -30
		}
	}

	local function NotifyPlayer(ply, killer)
		local num = RolePoints[killer:GetRole()][ply:GetRole()]
		local bool = string.find(num, "-")
		if bool then
			killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You had "..num.." points taken away for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".")
		else
			killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were awarded "..num.." points for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".")
		end
	
		killer:PS_GivePoints(num)
	end

	hook.Add("DoPlayerDeath", "PS.GivePointsOnDeath", function(ply, killer, dmginfo)
		if !IsValid(killer) or !killer:IsPlayer() or !IsValid(ply) or !ply:IsPlayer() or (ply == killer) or !ply:Alive() then return end
		if GetRoundState() == ROUND_ACTIVE then
			NotifyPlayer(ply, killer)
		end
	end)
end)


replace the quote with code tags please.

Please do so.

And please format it a little, it’s hard to read when everything is on the same tab. (It’s not hard to read, but it’s good practice)

I am bored atm so here’s the code in Code Wraps and a bit formatted.



hook.Add("Initialize", "Points.Initialize", function()
	if !ROLE_INNOCENT then return end
	
	local RolePoints = {
		[ROLE_DETECTIVE] = {
			[ROLE_DETECTIVE] = -30,
			[ROLE_INNOCENT] = -10,
			[ROLE_TRAITOR] = 200
		},
		[ROLE_INNOCENT] = {
			[ROLE_DETECTIVE] = -50,
			[ROLE_INNOCENT] = -20,
			[ROLE_TRAITOR] = 50
		},
		[ROLE_TRAITOR] = {
			[ROLE_DETECTIVE] = 200,
			[ROLE_INNOCENT] = 25,
			[ROLE_TRAITOR] = -30
		}
	}

	local function NotifyPlayer(ply, killer)
		local num = RolePoints[killer:GetRole()][ply:GetRole()]
		local bool = string.find(num, "-")
		if bool then
			killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You had "..num.." points taken away for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".")
		else
			killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were awarded "..num.." points for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".")
		end
	
		killer:PS_GivePoints(num)
	end

	hook.Add("DoPlayerDeath", "PS.GivePointsOnDeath", function(ply, killer, dmginfo)
		if !IsValid(killer) or !killer:IsPlayer() or !IsValid(ply) or !ply:IsPlayer() or (ply == killer) or !ply:Alive() then return end
		if GetRoundState() == ROUND_ACTIVE then
			NotifyPlayer(ply, killer)
		end
	end)
end)


Thank you for doing that hehe, anybody help?

Yes, all you need to do is if someone forgives, someone else, you add his points back with PS_GivePoints(or something like that).

Sorry I’m not good with this, can someone make it save the points. So when you leave it saves.

Uhm, points are saved after leaving the server?

Not with this point system, seems that this point system isn’t saving

Ehm are you using Adam Burt0ns Pointshop System?
If you do so, points should safe :o

if you’re using pointshop burt0n then make sure that your Pointshop is configured to save things serverside, and not through MySQL or anything. Or else it just won’t save

Pointshop saves when points given every 5 minute’s but that point system doesn’t seem to have points saved