Tete omar Posted May 16, 2012 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 ..........
FatalTerror Posted May 16, 2012 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
Tete omar Posted May 16, 2012 Author 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
Guest Guest4401 Posted May 16, 2012 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
Tete omar Posted May 16, 2012 Author 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 !!!
Tete omar Posted May 16, 2012 Author 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
Guest Guest4401 Posted May 16, 2012 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)
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