Jump to content

identify money move


Estevam2d

Recommended Posts

how to tell if I actually have money to move?

Server.lua

function ls (thePlayer) 
     local playeraccount = getPlayerAccount ( thePlayer ) 
            takePlayerMoney ( thePlayer, 4000 )                 
    setElementPosition ( thePlayer, 1481.0520019531,-1765.6591796875,18.795755386353 ) 
    outputChatBox ('#FFFFFF[ #0DDFFFSpawn de LS#FFFFFF ]: #00FFFF' .. getPlayerName(thePlayer) .. ' #828282Foi para Los Santos por #FF0000$ -1000 #FFFFFF(#00FF00 /ls #FFFFFF)', root, 255, 255, 255, true) 
end 
addCommandHandler ( "ls", ls ) 

Link to comment
function ls(thePlayer) 
    if (getPlayerMoney(thePlayer) >= 1000) then 
        takePlayerMoney ( thePlayer, 1000 )                 
        setElementPosition ( thePlayer, 1481.0520019531,-1765.6591796875,18.795755386353 ) 
        outputChatBox ('#FFFFFF[ #0DDFFFSpawn de LS#FFFFFF ]: #00FFFF' .. getPlayerName(thePlayer) .. ' #828282Foi para Los Santos por #FF0000$ -1000 #FFFFFF(#00FF00 /ls #FFFFFF)', root, 255, 255, 255, true) 
    else 
        outputChatBox ("Dinheiro insuficiente para usar este comando", thePlayer, 255, 255, 255, true) 
    end 
end 
addCommandHandler( "ls", ls ) 

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