[Ska]Vladmo Posted March 24, 2008 Share Posted March 24, 2008 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! Link to comment
Ace_Gambit Posted March 24, 2008 Share Posted March 24, 2008 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) Link to comment
[Ska]Vladmo Posted March 24, 2008 Author Share Posted March 24, 2008 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) Oh thanks and sorry for bein mean to ya earlier was havin' bad day Shouldn't let it on forum Link to comment
[Ska]Vladmo Posted March 24, 2008 Author Share Posted March 24, 2008 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! Link to comment
DiSaMe Posted March 24, 2008 Share Posted March 24, 2008 if (source ~= attacker) then givePlayerMoney(attacker, ggg) end Link to comment
[Ska]Vladmo Posted March 24, 2008 Author Share Posted March 24, 2008 if (source ~= attacker) then givePlayerMoney(attacker, ggg) end Thanks it worked. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now