Jump to content

money drop


Recommended Posts

Posted (edited)

hey, i have a money drop script, but i wont when the player suicides lose his money, someone know how to do when he suicide dont lose it? here is my code

code removed

Edited by Guest
Posted (edited)
in playerJustGotDied check if theres "attacker" variable set to element.. if theres no attacker = suicide..

I think it works what i did but i dint tested with another player, here is the code

code removed

Edited by Guest
Posted
function playerJustGotDied(ammo, attacker, weapon, bodypart)
if (attacker ~= source) and (attacker ~= nil) then
cancelEvent()
else
createMoney(source);
end
end

Duude!! cancelEvent ??!!

You want to cancel death?

function playerJustGotDied(ammo, attacker, weapon, bodypart)
if (isElement(attacker)) then
   createMoney(source)
end
-- no need for else.. we just do nothing

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...