TonyJunakPRO Posted April 3, 2011 Share Posted April 3, 2011 can someone make timer script what will remove 1$ each 2 minutes(only will remove money when GUI window is visible) and also if money is 0 message will appear Link to comment
Castillo Posted April 3, 2011 Share Posted April 3, 2011 I would like to see you trying something before ask, you can always use the wiki page to learn. https://wiki.multitheftauto.com/wiki/SetTimer Link to comment
TonyJunakPRO Posted April 3, 2011 Author Share Posted April 3, 2011 ok, but i dont know script for money removing Link to comment
Castillo Posted April 3, 2011 Share Posted April 3, 2011 the function is: setPlayerMoney Link to comment
TonyJunakPRO Posted April 3, 2011 Author Share Posted April 3, 2011 so i write setPlayerMoney(-1), right Link to comment
TonyJunakPRO Posted April 3, 2011 Author Share Posted April 3, 2011 and what code is for if player money is 0 Link to comment
Castillo Posted April 3, 2011 Share Posted April 3, 2011 getPlayerMoney Take some of your time to search for the functions! Link to comment
TonyJunakPRO Posted April 3, 2011 Author Share Posted April 3, 2011 whatever i write it cant work, please help i am noob at mta coding Link to comment
Castillo Posted April 3, 2011 Share Posted April 3, 2011 Well, maybe it is time to learn? try it harder, it is very easy. Link to comment
TonyJunakPRO Posted April 3, 2011 Author Share Posted April 3, 2011 it is easy for you becouse you are mta coder, but i am not i am only .net programmer Link to comment
Castillo Posted April 3, 2011 Share Posted April 3, 2011 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) Link to comment
TonyJunakPRO Posted April 3, 2011 Author Share Posted April 3, 2011 will it do it every two minute Link to comment
Castillo Posted April 3, 2011 Share Posted April 3, 2011 120000 = two minutes in milliseconds, and now go and try the code 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