Jump to content

drop all the money!


Nec

Recommended Posts

bool setPlayerMoney (int amount )

function setCash ( thePlayer, command, amount )

setPlayerMoney ( thePlayer, tonumber(amount) )

addCommandHandler ( "dardinero", setCash )

i need a script to drop all the money on your hand like a rpg :)

Link to comment

bool setPlayerMoney (int amount )

function setCash ( thePlayer, command, amount )

setPlayerMoney ( thePlayer, tonumber(amount) )

addCommandHandler ( "dardinero", setCash )

i need a script to drop all the money on your hand like a rpg :)

Link to comment
bool setPlayerMoney (int amount )

function setCash ( thePlayer, command, amount )

setPlayerMoney ( thePlayer, tonumber(amount) )

addCommandHandler ( "dardinero", setCash )

i need a script to drop all the money on your hand like a rpg :)

-- Not tested
addEventHandler("onPlayerWasted", getRootElement(),
function()
local player = source
 
local money = getPlayerMoney(player)
local x, y, z = getElementPosition(player)
createPickup(x, y, z, 3, 1274, 0, money)
end
)

Is this what you mean?

Link to comment
bool setPlayerMoney (int amount )

function setCash ( thePlayer, command, amount )

setPlayerMoney ( thePlayer, tonumber(amount) )

addCommandHandler ( "dardinero", setCash )

i need a script to drop all the money on your hand like a rpg :)

-- Not tested
addEventHandler("onPlayerWasted", getRootElement(),
function()
local player = source
 
local money = getPlayerMoney(player)
local x, y, z = getElementPosition(player)
createPickup(x, y, z, 3, 1274, 0, money)
end
)

Is this what you mean?

Link to comment
mayba
-- Not tested
function money(playerSource)
local money = getPlayerMoney(playerSource)
local x, y, z = getElementPosition(playerSource)
createPickup(x, y, z, 3, 1274, 0, money)
end
addEventHandler("onPlayerWasted", getRootElement(), money )

Two problems:

1) You're creating the pickup on top of the player. I'm not sure, but that could be a problem, I guess...

2) You're not removing the player's money. Use takePlayerMoney.

Link to comment
mayba
-- Not tested
function money(playerSource)
local money = getPlayerMoney(playerSource)
local x, y, z = getElementPosition(playerSource)
createPickup(x, y, z, 3, 1274, 0, money)
end
addEventHandler("onPlayerWasted", getRootElement(), money )

Two problems:

1) You're creating the pickup on top of the player. I'm not sure, but that could be a problem, I guess...

2) You're not removing the player's money. Use takePlayerMoney.

Link to comment

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