Norhy Posted August 2, 2013 Share Posted August 2, 2013 Please, what's wrong in this code? if (getPlayerMoney(player) > 2500) then -- and then setPlayerMoney(player, getPlayerMoney(player) - 2500 ) It is Client-side. Link to comment
Castillo Posted August 2, 2013 Share Posted August 2, 2013 If you set/give/take money client side it won't sync with the server. Link to comment
Sasu Posted August 2, 2013 Share Posted August 2, 2013 You can use takePlayerMoney to take an amount money of the player that you want. Link to comment
-.Paradox.- Posted August 3, 2013 Share Posted August 3, 2013 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) 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