Jump to content

Money


Norhy

Recommended Posts

Posted

Please, what's wrong in this code?

  
if (getPlayerMoney(player) > 2500) then 
-- and then 
setPlayerMoney(player, getPlayerMoney(player) - 2500 ) 

It is Client-side.

Posted

If you set/give/take money client side it won't sync with the server.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

He is right, try this one

server.lua

    local killerMoney = 1000    --Amount of money when you kill somebody. 
    local deadPlayerMoney = 1000   --Amount of money you lose when you die. 
    local joinMoney = 1000   --Amount of money you earn when you join the server. 
function spawnOnJoin() 
    givePlayerMoney(source, joinMoney) 
end 
function spawnOnDead(ammo, killer, weapon, bodypart) 
    takePlayerMoney(source, deadPlayerMoney) 
    if (killer) and (killer ~= source) then 
        givePlayerMoney(killer, killerMoney) 
    end 
end 
  
addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) 
addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead) 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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