Tete omar Posted May 16, 2012 Share Posted May 16, 2012 function checkMoney(thePlayer, command) local money = getPlayerMoney(thePlayer) if (money > 1000) then outputChatBox("You are rich: " .. tostring(money), thePlayer) else outputChatBox("Poor guy...", thePlayer) end end addCommandHandler("checkMoney", checkMoney) Doesn't run .......... Link to comment
FatalTerror Posted May 16, 2012 Share Posted May 16, 2012 Why you put tostring(money) ? It's int no? function checkMoney(thePlayer, command) local money = getPlayerMoney(thePlayer) if (money > 1000) then outputChatBox("You are rich: " .. tonumber(money), thePlayer) else outputChatBox("Poor guy...", thePlayer) end end addCommandHandler("checkMoney", checkMoney) And it's on server side. Good Luck Link to comment
Kenix Posted May 16, 2012 Share Posted May 16, 2012 outputChatBox Already converted number to string. Link to comment
Tete omar Posted May 16, 2012 Author Share Posted May 16, 2012 Why you put tostring(money) ?It's int no? function checkMoney(thePlayer, command) local money = getPlayerMoney(thePlayer) if (money > 1000) then outputChatBox("You are rich: " .. tonumber(money), thePlayer) else outputChatBox("Poor guy...", thePlayer) end end addCommandHandler("checkMoney", checkMoney) And it's on server side. Good Luck It still don't work Link to comment
Guest Guest4401 Posted May 16, 2012 Share Posted May 16, 2012 Type exactly /checkMoney If it doesn't work then the script isn't serversided or you did something wrong in meta.xml Link to comment
Tete omar Posted May 16, 2012 Author Share Posted May 16, 2012 Type exactly /checkMoneyIf it doesn't work then the script isn't serversided or you did something wrong in meta.xml "Tete" type="script" version="1.0.0"/> It works thanks !!! Link to comment
Tete omar Posted May 16, 2012 Author Share Posted May 16, 2012 But i have a little problem .. color codes function checkmoney(thePlayer, command) local money = getPlayerMoney(thePlayer) if (money > 199999) then outputChatBox("Your money stat: You are rich |congratulations| : D ! " .. tonumber(money), thePlayer) else outputChatBox("Your money stat: You are poor |work hard| : ( ", thePlayer) end end addCommandHandler("checkmoney", checkmoney) It shows like that .# 00ff00 Your money stat: You're rich .. not green Link to comment
Guest Guest4401 Posted May 16, 2012 Share Posted May 16, 2012 function checkmoney(thePlayer, command) local money = getPlayerMoney(thePlayer) if (money > 199999) then outputChatBox("#00ff00Your money stat: You are rich |congratulations| : D ! " .. tonumber(money), thePlayer,255,255,255,true) else outputChatBox("#ff0000Your money stat: You are poor |work hard| : ( ", thePlayer,255,255,255,true) end end addCommandHandler("checkmoney", checkmoney) 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