ManeXi Posted May 5, 2016 Share Posted May 5, 2016 (edited) Basically when I kill myself with a Greanade it gives me money and kills. function player_Wasted ( ammo, attacker, weapon, bodypart ) if ( attacker ) then giveKill(attacker) setkdr(attacker) triggerClientEvent(source,"startRespawnShow",source,attacker,weapon) giveDeath(source) setkdr(source) setCameraTarget(source,attacker) else triggerClientEvent(source,"startRespawnShow",source,source,0) giveDeath(source) setkdr(source) end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) Edited May 9, 2016 by Guest Link to comment
Anubhav Posted May 6, 2016 Share Posted May 6, 2016 if attacker == source then Use that if statement. If you kill yourself, that will go on. Link to comment
ManeXi Posted May 8, 2016 Author Share Posted May 8, 2016 Still not working This is the function for "giveKill" function giveKill ( player ) if getElementType(player) == "player" then setElementData(player,"Kills",getElementData(player,"Kills") + 1) local acc = getPlayerAccount(player) if not isGuestAccount(acc) then setAccountData(acc,"Kills",getElementData(player,"Kills") + 1) local mo = getAccountData(getPlayerAccount(player),"Money") setPlayerMoney(player,tonumber(mo) + 50) setAccountData(acc,"Money",tonumber(mo) + 50) setElementHealth(player, getElementHealth(player) + 35) end end end Link to comment
MACIEKW89 Posted May 8, 2016 Share Posted May 8, 2016 Try: function player_Wasted ( ammo, attacker, weapon, bodypart ) if attacker then if attacker==source then triggerClientEvent(source,"startRespawnShow",source,source,0) giveDeath(source) setkdr(source) else giveKill(attacker) setkdr(attacker) triggerClientEvent(source,"startRespawnShow",source,attacker,weapon) giveDeath(source) setkdr(source) setCameraTarget(source,attacker) end else triggerClientEvent(source,"startRespawnShow",source,source,0) giveDeath(source) setkdr(source) end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) 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