Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ply = LocalPlayer()
- function GM:OnNPCKilled(victim, ent, weapon)
- -- If something killed the npc
- if not ent then return end
- if ent:IsVehicle() and ent:GetDriver():IsPlayer() then ent = ent:GetDriver() end
- -- If it wasn't a player directly, find out who owns the prop that did the killing
- if not ent:IsPlayer() then
- ent = Player(tonumber(ent.SID) or 0)
- end
- -- If we know by now who killed the NPC, pay them.
- if ply:Team() == TEAM_HUNTER then
- if IsValid(ent) and GAMEMODE.Config.npckillpay > 0 then
- ent:addMoney(GAMEMODE.Config.npckillpay)
- DarkRP.notify(ent, 0, 4, DarkRP.getPhrase("npc_killpay", DarkRP.formatMoney(GAMEMODE.Config.npckillpay)))
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement