Tete omar Posted May 16, 2012 Share Posted May 16, 2012 function checkmoney(thePlayer, command) local money = getPlayerMoney(thePlayer) if (money > 199999) then outputChatBox("#FFFF00Your money stat: #00ff00You are rich ! $" .. tonumber(money), thePlayer,255,255,255,true) else if (money > 999999) then outputChatBox("#FFFF00Your money stat: #00ff00You are so rich ! $$" .. tonumber(money), thePlayer,255,255,255,true) else outputChatBox("#FFFF00Your money stat: #FF0000You are poor (Be serious in work) ", thePlayer,255,255,255,true) end end addCommandHandler("checkmoney", checkmoney) Doesn't run I want it rich,so rich,poor Link to comment
Jaysds1 Posted May 16, 2012 Share Posted May 16, 2012 try using "elseif", instead of doing "else if" Example: if money > 100 then --code elseif money < 100 then --code end I'll fix this for you: function checkmoney(thePlayer, command) local money = getPlayerMoney(thePlayer) if (money > 199999) then outputChatBox("#FFFF00Your money stat: #00ff00You are rich ! $" .. tonumber(money), thePlayer,255,255,255,true) elseif(money > 999999) then outputChatBox("#FFFF00Your money stat: #00ff00You are so rich ! $$" .. tonumber(money), thePlayer,255,255,255,true) else outputChatBox("#FFFF00Your money stat: #FF0000You are poor (Be serious in work) ", thePlayer,255,255,255,true) end end addCommandHandler("checkmoney", checkmoney) Plus you forgot to close the last "if" with "end". Link to comment
Kenix Posted May 16, 2012 Share Posted May 16, 2012 He not know lua and doing nonsense .. I written to him. I guess he not want learn. @teteomar: Well it's you choice. You can not know lua and something in mta scripting and you will ask 1000+ posts to help you with your code. Listen to me. It's not empty words. Doesn't runI want it rich,so rich,poor If you use /debugscript 3 it's said to you about syntax error. Link to comment
Tete omar Posted May 16, 2012 Author Share Posted May 16, 2012 He not know lua and doing nonsense .. I written to him. I guess he not want learn.@teteomar: Well it's you choice. You can not know lua and something in mta scripting and you will ask 1000+ posts to help you with your code. Listen to me. It's not empty words. Doesn't runI want it rich,so rich,poor If you use /debugscript 3 it's said to you about syntax error. I did it, Thanks ! it show all my line errors thanks Link to comment
Stanley Sathler Posted May 16, 2012 Share Posted May 16, 2012 Teteomar, I must agree with Kenix. I saw your other topics, and really, you looks not know Lua. You must learn it. Link to comment
Tete omar Posted May 17, 2012 Author Share Posted May 17, 2012 (edited) Teteomar, I must agree with Kenix. I saw your other topics, and really, you looks not know Lua. You must learn it. I must some one learn me lua because Wiki and LUA.org hard explanation if someone want learn me please add me email removed Remember " Wiki and LUA | hard explanation | Edited March 20, 2016 by Guest Link to comment
Tete omar Posted May 17, 2012 Author Share Posted May 17, 2012 try using "elseif", instead of doing "elseif" Example: if money > 100 then --code elseif money < 100 then --code end I'll fix this for you: function checkmoney(thePlayer, command) local money = getPlayerMoney(thePlayer) if (money > 199999) then outputChatBox("#FFFF00Your money stat: #00ff00You are rich ! $" .. tonumber(money), thePlayer,255,255,255,true) elseif(money > 999999) then outputChatBox("#FFFF00Your money stat: #00ff00You are so rich ! $$" .. tonumber(money), thePlayer,255,255,255,true) else outputChatBox("#FFFF00Your money stat: #FF0000You are poor (Be serious in work) ", thePlayer,255,255,255,true) end end addCommandHandler("checkmoney", checkmoney) Plus you forgot to close the last "if" with "end". Thanks Link to comment
Jaysds1 Posted May 17, 2012 Share Posted May 17, 2012 Here: Scripting>Tutorial>Lua Tutorials, Manuals: viewtopic.php?f=148&t=40809 Link to comment
Stanley Sathler Posted May 17, 2012 Share Posted May 17, 2012 Teteomar, I'm sorry if I'm being rude, but we aren't teachers. If we know, is because we use the Wiki and LUA Manual. Yes, I agree with you: it's hard. But we need try, bro. Read, and read again, and again. Link to comment
Tete omar Posted May 18, 2012 Author Share Posted May 18, 2012 Teteomar, I'm sorry if I'm being rude, but we aren't teachers. If we know, is because we use the Wiki and LUA Manual. Yes, I agree with you: it's hard. But we need try, bro. Read, and read again, and again. I read it about 41 times each day and i still don't understand Link to comment
Axel Posted May 18, 2012 Share Posted May 18, 2012 I suggest you to take a look in all uncompiled comunity scripts. Modify them to fit your needs and start making your own inspiring from there. You got wiki to help you.. It's not that hard Link to comment
Tete omar Posted May 18, 2012 Author Share Posted May 18, 2012 I suggest you to take a look in all uncompiled comunity scripts. Modify them to fit your needs and start making your own inspiring from there. You got wiki to help you.. It's not that hard Where is these scripts ? Link to comment
X-SHADOW Posted May 18, 2012 Share Posted May 18, 2012 use my script https://community.multitheftauto.com/ind ... ls&id=3912 Link to comment
Tete omar Posted May 18, 2012 Author Share Posted May 18, 2012 use my script https://community.multitheftauto.com/ind ... ls&id=3912 Shadow i was made it by guieditor take a look GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|PlanetsTrip|=====\nWelcome to the\" Planets trip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Tickets|====\nMoon 50,000$\nMars 64,000$\nVenus 54,000$\nSaturn 75,000$\nMercury 35,000$=====|PlanetsTrip|====",false,GUIEditor_Window[1]) addEventHandler('guiSetVisible') And i think it's not alright :\ Link to comment
Alpha Posted May 18, 2012 Share Posted May 18, 2012 addEventHandler('guiSetVisible') What's that? GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|PlanetsTrip|=====\nWelcome to the\" Planets trip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Tickets|====\nMoon 50,000$\nMars 64,000$\nVenus 54,000$\nSaturn 75,000$\nMercury 35,000$=====|PlanetsTrip|====",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1], false) 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