[Need Help]Give/Take money on player kill and notification
10 replies, posted
hook.Add("PlayerDeath", "givemonez", function(ply, weapon, killer)
if table.HasValue({"user"}, ply:GetNWString("usergroup")) and IsValid(killer) then
killer:addMoney(-500)
end
if table.HasValue({"jedi"}, ply:GetNWString("usergroup")) and IsValid(killer) then
killer:addMoney(100)
end
end)
hook.Add("FriendlyFire", "teamkill", function ENT:Use( activator, caller )
DarkRP.notify (activator, 0, 4, "you killed teammate")
end)
So i dont know how can i link Notify with player kill can anyone help?
Just put your notify code under where you take their money?
just put DarkRP.notify (activator, 0, 4, "you killed teammate") under addmoney(100)??
Yes but not activator, put ply instead
Thank you hlped me a lot
hook.Add("PlayerDeath", "givemonez", function(ply, weapon, killer)
if ply:IsAdmin() or ply:IsSuperAdmin() or ply:IsUserGroup("superadmin") then
DarkRP.notify (ply, 0, 4, "you killed teammate")
else
killer:addMoney(-500)
DarkRP.notify (ply, 0, 4, "you killed teammate")
end
end)
so 1.the darkrp notify not working
2.i want superadmin to not take this effect but they still taken money when they kill user