Jump to content

timer?


Recommended Posts

Posted
it is easy for you becouse you are mta coder, but i am not i am only .net programmer

I'am whatever you say, but i had to learn to be like i'am right now.

i will give you the code, but it is the last time.

--client side

function checkMoney() 
if guiGetVisible(ScreenLocked) then -- We check if the window is visible. 
triggerServerEvent("take_money",getLocalPlayer()) -- it uses to make bugs with client side take money function. 
    end 
end 
setTimer(checkMoney,120000,0) 

--server side

  
addEvent("take_money",true) 
addEventHandler("take_money",getRootElement(), 
function () 
local money = getPlayerMoney(source) -- We get the player money. 
if not money >= 0 then -- We check if the player money is below or equal to 0. 
setPlayerMoney(source,tonumber(money)-1) -- We set the player's money -1 
else -- We output a message to the player telling him his money is 0. 
outputChatBox("Your money is 0!",source,255,0,0) 
  end 
end) 

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