Bilal135 Posted October 21, 2014 Share 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 ) Link to comment
Moderators IIYAMA Posted October 21, 2014 Moderators Share Posted October 21, 2014 strange error: Maybe it is: "--" Try to replace it with: text -" .. "- text Link to comment
Jaydan Posted October 21, 2014 Share 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) Link to comment
Anubhav Posted October 21, 2014 Share 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. Link to comment
Jaydan Posted October 22, 2014 Share 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 ]]. Link to comment
Dealman Posted October 22, 2014 Share Posted October 22, 2014 Correct me if I'm wrong but doesn't MTA use /r/n and not /n? Link to comment
.:HyPeX:. Posted October 23, 2014 Share 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. Link to comment
Dealman Posted October 23, 2014 Share 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. Link to comment
.:HyPeX:. Posted October 24, 2014 Share 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.... 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