• [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
hook.Add("PlayerDeath", "rp.givemoney.deathz", function( victim, inflictor, attacker ) if attacker:IsAdmin() then DarkRP.notify ( attacker, 0, 4, "you killed teammate") else victim:addMoney(-500) DarkRP.notify ( attacker, 0, 4, "you killed teammate") end end) --> darkrp_modules/rp_moneydeath/sv_givemoneydeath.lua
hook.Add("PlayerDeath", "givemonez", function(ply, weapon, killer) if killer:IsSuperAdmin() then DarkRP.notify (killer, 0, 4, "you killed teammate") else killer:addMoney(-500) DarkRP.notify (killer, 0, 4, "you killed teammate you dumb idiot retard") end end)
use 'ply' instead of 'killer' in if killer:issuperadmin() then
Why would you use ply? He wants the display if you're the killer not the killed?
thank it work perfectly also thank everyone for helping me
Sorry, you need to Log In to post a reply to this thread.