Jump to content

givePlayerMoney kills


Recommended Posts

Posted

Alright I got my line of code

givePlayerMoney ( source, 100 ) 

I made the code like this because I didn't want to mess around with it differently, this is the way I know.

But I am not sure where to put it so when someone kills someone the killer gets 1k cash.

This may sound easy to you but it is not easy for me, hope you can help, thanks in advanced!

Posted

You could put it in the onPlayerWasted event.

  
local ggg = 1000 
  
function player_Wasted(ammo, attacker, weapon, bodypart) 
   -- give $1000 for every kill 
   givePlayerMoney(attacker, ggg) 
end 
  
addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) 
  

Posted
You could put it in the onPlayerWasted event.
  
local ggg = 1000 
  
function player_Wasted(ammo, attacker, weapon, bodypart) 
   -- give $1000 for every kill 
   givePlayerMoney(attacker, ggg) 
end 
  
addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) 
  

I'll change attacker, ggg) change to attacker, 1000) :wink:

Oh thanks and sorry for bein mean to ya earlier was havin' bad day

:wink: Shouldn't let it on forum

Posted

Alright I found a bug now, if the person drowns or commites suicide or theres no killer, the person who died gets the money, if you know how to fix this much appreciated!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...