Jump to content

[HELP]Moneycheck


Recommended Posts

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

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

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

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

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