• Need Help with a DarkRP custom job perk.
    4 replies, posted
So, I've Created A custom job, and I want it to be able to gain money, by killing ONLY with a specific weapon, in DarkRP. The only catch is, I would only want Melee kills to trigger this effect, i.e. Knife, fists, crowbar and custom melee weapons. Can anyone help me? My DarkRP server version is 2.5.1 The goal is for the job to be able to make 50 bucks per knife, crowbar, melee, etc. kill. Its not a hit men and doesn't require a menu. it just... simply is.
[url]http://wiki.garrysmod.com/page/GM/PlayerDeath[/url] That wiki page should help you out.
[QUOTE=Jeezy;44291224][url]http://wiki.garrysmod.com/page/GM/PlayerDeath[/url] That wiki page should help you out.[/QUOTE] It tells me how to begin, but i still wouldn't know how to get it to check if i'm using a spacific weapon, and if so, add money. I'm eyeballing if ( victim == attacker ), and i know its asking if the victim was killed by myself, but how would i bend this code into it asking me if death was caused by a spacific weapon?
Compare the class of the second argument in the hook to the weapons you want to reward money.
[QUOTE]function GM:PlayerDeath( victim, inflictor, attacker ) if ( inflictor == weapon_fists ) then PrintMessage( HUD_PRINTTALK, victim:Name() .. " committed suicide." ), Player:addMoney(50) end[/QUOTE] and if so, where would i place it (which LUA script) and would i need additional code to make it TEAM_SERIALKILLER job exclusive? I kept the committed suicide on purpose. I thought it'd be clever, since my custom job i'm creating would require stealth, it would use the hud message as a cover, so the serial killer could only be discovered by eye witnesses.
Sorry, you need to Log In to post a reply to this thread.