florent6001 Posted July 7, 2016 Share Posted July 7, 2016 Hi all, My userpanel doesn't give money when i die, someones can help me? This is my script: function earnMoneyForDeath(whatPosition,player) if whatPosition == 1 then if isPlayerLogged(player) then local playerCount = #getElementsByType("player") if infos.minPlayer <= playerCount then local expToEarn = playerCount*5 local cashToEarn = playerCount*25 addDataValue ( player, "cash", cashToEarn) addDataValue ( player, "points", expToEarn) earnTeamExpAndCash(player,expToEarn,cashToEarn) outputChatBox("[EARNED] #FFFFFF You won $"..cashToEarn.." and "..expToEarn.." points.",player,_r,_g,_b,true) else outputChatBox("[EARNED] #FFFFFF Minimum Players Required to Earn Points / Cash : "..infos.minPlayer..".",player,_r,_g,_b,true) end end else if isPlayerLogged(player) then local playerCount = #getElementsByType("player") if infos.minPlayer <= playerCount then local expToEarn = (playerCount-whatPosition)*4 local cashToEarn = (playerCount-whatPosition)*20 addDataValue ( player, "cash", cashToEarn) addDataValue ( player, "points", expToEarn) earnTeamExpAndCash(player,expToEarn,cashToEarn) outputChatBox("[EARNED] #FFFFFF You won $"..cashToEarn.." and "..expToEarn.." points.",player,_r,_g,_b,true) else outputChatBox("[EARNED] #FFFFFF Minimum Players Required to Earn Points / Cash "..infos.minPlayer..".",player,_r,_g,_b,true) end end end end addEvent("onPlayerDeadInRace",true) addEventHandler("onPlayerDeadInRace",getRootElement(),earnMoneyForDeath) Link to comment
Calculador Posted July 7, 2016 Share Posted July 7, 2016 surely the function addDateValue doesn't work correctly, check this function. Link to comment
florent6001 Posted July 7, 2016 Author Share Posted July 7, 2016 Resolved, that was: earnMoneyForDeath thx Link to comment
Calculador Posted July 8, 2016 Share Posted July 8, 2016 Resolved, that was: earnMoneyForDeath thx No problem 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