Bilal135 Posted October 21, 2014 Posted October 21, 2014 Hi, I'm having a little bit problem with the script, I made a gui on gui editor, and made a bind key for to open it. But the console gives some error. Error: Unfinished Strip Near '-Multi Theft Auto San Andreas Cheats And Codes--' My code: GUIEditor = { window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(572, 238, 337, 226, "Cheats And Codes Help Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(9, 24, 318, 192, "- Multi Theft Auto Cheats And Codes -- \n \nCheat Code Commands: \n \n/power - Gives you 100 power. \n/rhino - Creates a tank for you. \n/givemejetpack - Gives you a jetpack. \n/givemeweapons - Gives you many weapons. \n/moneymoneymoney - Gives you 1000000 money. \n/policecantgetme - Sets your wanted level to 2. \n/jumpjet - Creates a hydra for you. \n/toodamnhot - Sets weather to scorching hot. \n/professionalkiller - Sets your weapon stats to max. \n \n--", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) end ) bindKey ( "o", "down", function ( ) guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end ) "Get busy living or get busy dying"
Moderators IIYAMA Posted October 21, 2014 Moderators Posted October 21, 2014 strange error: Maybe it is: "--" Try to replace it with: text -" .. "- text Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Jaydan Posted October 21, 2014 Posted October 21, 2014 GUIEditor = { window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(572, 238, 337, 226, "Cheats And Codes Help Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(9, 24, 318, 192, [[-- Multi Theft Auto Cheats And Codes -- Cheat Code Commands: /power - Gives you 100 power. /rhino - Creates a tank for you. /givemejetpack - Gives you a jetpack. /givemeweapons - Gives you many weapons. /moneymoneymoney - Gives you 1000000 money. /policecantgetme - Sets your wanted level to 2. /jumpjet - Creates a hydra for you. /toodamnhot - Sets weather to scorching hot. /professionalkiller - Sets your weapon stats to max. ]], false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) end ) bindKey ( "o", "down", function ( ) guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) end ) Edit; fixed your typos on the bindKey function. GUIEditor_window = {} GUIEditor_memo = {} function LoadGui() GUIEditor_window[1] = guiCreateWindow(572, 238, 337, 226, "Cheats And Codes Help Panel", false) guiWindowSetSizable(GUIEditor_window[1], false) GUIEditor_memo[1] = guiCreateMemo(9, 24, 318, 192, [[-- Multi Theft Auto Cheats And Codes -- Cheat Code Commands: /power - Gives you 100 power. /rhino - Creates a tank for you. /givemejetpack - Gives you a jetpack. /givemeweapons - Gives you many weapons. /moneymoneymoney - Gives you 1000000 money. /policecantgetme - Sets your wanted level to 2. /jumpjet - Creates a hydra for you. /toodamnhot - Sets weather to scorching hot. /professionalkiller - Sets your weapon stats to max. ]] , false, GUIEditor_window[1]) guiMemoSetReadOnly(GUIEditor_memo[1], true) end addEventHandler("onClientResourceStart", resourceRoot, LoadGui) function showGui() if (guiGetVisible ( GUIEditor_window[1] )) then guiSetVisible(GUIEditor_window[1], false) showCursor(false) else guiSetVisible(GUIEditor_window[1], true) showCursor(true) end end addCommandHandler("cheatcodeshelp", showGui)
Anubhav Posted October 21, 2014 Posted October 21, 2014 Actually its all because of the \n. You must stick the code together. * worst error when I saw it * It should realy be reported. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Jaydan Posted October 22, 2014 Posted October 22, 2014 Actually its all because of the \n. You must stick the code together. * worst error when I saw it *It should realy be reported. No it isn't when multi lining strings you use [[ text here ]].
Dealman Posted October 22, 2014 Posted October 22, 2014 Correct me if I'm wrong but doesn't MTA use /r/n and not /n? If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
.:HyPeX:. Posted October 23, 2014 Posted October 23, 2014 Correct me if I'm wrong but doesn't MTA use /r/n and not /n? /n alone works too, tried it already. not sure what /r does. My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
Dealman Posted October 23, 2014 Posted October 23, 2014 Correct me if I'm wrong but doesn't MTA use /r/n and not /n? /n alone works too, tried it already. not sure what /r does. Oh yeah, makes sense now - it was for a logging system I was working on. And since I was writing it to a text file - I had to use /r/n since that's what Windows uses. If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
.:HyPeX:. Posted October 24, 2014 Posted October 24, 2014 Correct me if I'm wrong but doesn't MTA use /r/n and not /n? /n alone works too, tried it already. not sure what /r does. Oh yeah, makes sense now - it was for a logging system I was working on. And since I was writing it to a text file - I had to use /r/n since that's what Windows uses. Ehm still not sure, if you're using fileWrite /n works alone too.... My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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