Fox261098 Posted May 15, 2016 Posted May 15, 2016 Hello i made an mini script but it shows me some errors like Ban Argument addEventHandler and how to bind key to open gui?.Here is the code GUIEditor = { button = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0, 4, 544, 413, "Mini admin panel.By LuckyDude", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF7F7F7F") GUIEditor.edit[1] = guiCreateEdit(9, 266, 510, 126, "This is a new mini adminpanel.Made by LuckyDude", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(15, 29, 242, 82, "Flip Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") GUIEditor.button[2] = guiCreateButton(15, 183, 242, 73, "Fix Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") GUIEditor.button[3] = guiCreateButton(282, 29, 242, 73, "50k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") GUIEditor.button[5] = guiCreateButton(287, 183, 242, 73, "10k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], "sa-header") end addCommandHandler ("mini",gui) ) addEventHandler("onClientRender", root, function() dxDrawText("Race Admin Panel", 60, 431, 501, 574, tocolor(0, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(60, 495, 435, 495, tocolor(60, 251, 16, 255), 4, false) end ) function flip ( ) local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( theVehicle and getVehicleController ( theVehicle ) == localPlayer ) then local rx, ry, rz = getVehicleRotation ( theVehicle ) if ( rx > 110 ) and ( rx < 250 ) then local x, y, z = getElementPosition ( theVehicle ) setVehicleRotation ( theVehicle, rx + 180, ry, rz ) setElementPosition ( theVehicle, x, y, z + 2 ) end end end addEventHandler("onClientGUIClick", GUIEditor.button[1], flip, false) function fix (playerSource) local theVehicle = getPedOccupiedVehicle (playerSource) if theVehicle and getVehicleController ( theVehicle ) == playerSource then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !" , thePlayer) end end addEventHandler("onClientGUIClick", GUIEditor.button[2], fix, false) function consoleGiveCash ( thePlayer, command, amount ) givePlayerMoney ( thePlayer, 50000 ) end addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash, false) function consoleGiveCash2 ( thePlayer, command, amount ) givePlayerMoney ( thePlayer, 10000 ) end addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash2, false)
#|_oskar_|# Posted May 15, 2016 Posted May 15, 2016 GUIEditor = {button = {},window = {},edit = {}} addEventHandler("onClientResourceStart", resourceRoot, function () GUIEditor.window[1] = guiCreateWindow(0, 4, 544, 413, "Mini admin panel.By LuckyDude", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF7F7F7F") GUIEditor.edit[1] = guiCreateEdit(9, 266, 510, 126, "This is a new mini adminpanel.Made by LuckyDude", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(15, 29, 242, 82, "Flip Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") GUIEditor.button[2] = guiCreateButton(15, 183, 242, 73, "Fix Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") GUIEditor.button[3] = guiCreateButton(282, 29, 242, 73, "50k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") GUIEditor.button[5] = guiCreateButton(287, 183, 242, 73, "10k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], "sa-header") addCommandHandler ("mini",gui) --- Events addEventHandler("onClientGUIClick", GUIEditor.button[1], flip, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], fix, false) addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash, false) addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash2, false) end) addEventHandler("onClientRender", root, function() dxDrawText("Race Admin Panel", 60, 431, 501, 574, tocolor(0, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(60, 495, 435, 495, tocolor(60, 251, 16, 255), 4, false) end) function flip ( ) local theVehicle = getPedOccupiedVehicle (localPlayer ) if ( theVehicle and getVehicleController ( theVehicle ) == localPlayer ) then local rx, ry, rz = getElementPosition(theVehicle) setElementPosition(theVehicle, rx, ry, rz +0.3) end end function fix () local theVehicle = getPedOccupiedVehicle (localPlayer) if theVehicle and getVehicleController ( theVehicle ) == localPlayer then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !",255,255,0,true) end end function consoleGiveCash () givePlayerMoney (50000 ) end function consoleGiveCash2 () givePlayerMoney (10000 ) end
Fox261098 Posted May 15, 2016 Author Posted May 15, 2016 GUIEditor = {button = {},window = {},edit = {}} addEventHandler("onClientResourceStart", resourceRoot, function () GUIEditor.window[1] = guiCreateWindow(0, 4, 544, 413, "Mini admin panel.By LuckyDude", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF7F7F7F") GUIEditor.edit[1] = guiCreateEdit(9, 266, 510, 126, "This is a new mini adminpanel.Made by LuckyDude", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(15, 29, 242, 82, "Flip Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") GUIEditor.button[2] = guiCreateButton(15, 183, 242, 73, "Fix Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") GUIEditor.button[3] = guiCreateButton(282, 29, 242, 73, "50k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") GUIEditor.button[5] = guiCreateButton(287, 183, 242, 73, "10k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], "sa-header") addCommandHandler ("mini",gui) --- Events addEventHandler("onClientGUIClick", GUIEditor.button[1], flip, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], fix, false) addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash, false) addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash2, false) end) addEventHandler("onClientRender", root, function() dxDrawText("Race Admin Panel", 60, 431, 501, 574, tocolor(0, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(60, 495, 435, 495, tocolor(60, 251, 16, 255), 4, false) end) function flip ( ) local theVehicle = getPedOccupiedVehicle (localPlayer ) if ( theVehicle and getVehicleController ( theVehicle ) == localPlayer ) then local rx, ry, rz = getElementPosition(theVehicle) setElementPosition(theVehicle, rx, ry, rz +0.3) end end function fix () local theVehicle = getPedOccupiedVehicle (localPlayer) if theVehicle and getVehicleController ( theVehicle ) == localPlayer then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !",255,255,0,true) end end function consoleGiveCash () givePlayerMoney (50000 ) end function consoleGiveCash2 () givePlayerMoney (10000 ) end When i type /mini nothing happens
#|_oskar_|# Posted May 15, 2016 Posted May 15, 2016 GUIEditor = {button = {},window = {},edit = {}} Show = {} addEventHandler("onClientResourceStart", resourceRoot, function () GUIEditor.window[1] = guiCreateWindow(0, 4, 544, 413, "Mini admin panel.By LuckyDude", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF7F7F7F") GUIEditor.edit[1] = guiCreateEdit(9, 266, 510, 126, "This is a new mini adminpanel.Made by LuckyDude", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(15, 29, 242, 82, "Flip Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") GUIEditor.button[2] = guiCreateButton(15, 183, 242, 73, "Fix Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") GUIEditor.button[3] = guiCreateButton(282, 29, 242, 73, "50k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") GUIEditor.button[5] = guiCreateButton(287, 183, 242, 73, "10k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], "sa-header") addCommandHandler ("mini",gui) guiSetVisible (GUIEditor.window[1], false) --- Events addEventHandler("onClientGUIClick", GUIEditor.button[1], flip, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], fix, false) addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash, false) addEventHandler("onClientGUIClick", GUIEditor.button[5], consoleGiveCash2, false) end) --- function dx() dxDrawText("Race Admin Panel", 60, 431, 501, 574, tocolor(0, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(60, 495, 435, 495, tocolor(60, 251, 16, 255), 4, false) end --- function flip ( ) local theVehicle = getPedOccupiedVehicle (localPlayer ) if ( theVehicle and getVehicleController ( theVehicle ) == localPlayer ) then local rx, ry, rz = getElementPosition(theVehicle) setElementPosition(theVehicle, rx, ry, rz +0.3) end end --- function fix () local theVehicle = getPedOccupiedVehicle (localPlayer) if theVehicle and getVehicleController ( theVehicle ) == localPlayer then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !",255,255,0,true) end end --- function consoleGiveCash () givePlayerMoney (50000 ) end function consoleGiveCash2 () givePlayerMoney (10000 ) end --- Show.dX_ = function() Show.dx = (not Show.dx) removeEventHandler("onClientRender",root, dx) if (Show.dx) then addEventHandler("onClientRender",root, dx) end end function gui( ) guiSetVisible (GUIEditor.window[1],not guiGetVisible (GUIEditor.window[1])) showCursor (guiGetVisible (GUIEditor.window[1])) Show.dX_() end
Fox261098 Posted May 15, 2016 Author Posted May 15, 2016 GUIEditor = {button = {},window = {},edit = {}} Show = {} addEventHandler("onClientResourceStart", resourceRoot, function () GUIEditor.window[1] = guiCreateWindow(0, 4, 544, 413, "Mini admin panel.By LuckyDude", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF7F7F7F") GUIEditor.edit[1] = guiCreateEdit(9, 266, 510, 126, "This is a new mini adminpanel.Made by LuckyDude", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(15, 29, 242, 82, "Flip Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") GUIEditor.button[2] = guiCreateButton(15, 183, 242, 73, "Fix Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") GUIEditor.button[3] = guiCreateButton(282, 29, 242, 73, "50k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") GUIEditor.button[5] = guiCreateButton(287, 183, 242, 73, "10k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], "sa-header") addCommandHandler ("mini",gui) guiSetVisible (GUIEditor.window[1], false) --- Events addEventHandler("onClientGUIClick", GUIEditor.button[1], flip, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], fix, false) addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash, false) addEventHandler("onClientGUIClick", GUIEditor.button[5], consoleGiveCash2, false) end) --- function dx() dxDrawText("Race Admin Panel", 60, 431, 501, 574, tocolor(0, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(60, 495, 435, 495, tocolor(60, 251, 16, 255), 4, false) end --- function flip ( ) local theVehicle = getPedOccupiedVehicle (localPlayer ) if ( theVehicle and getVehicleController ( theVehicle ) == localPlayer ) then local rx, ry, rz = getElementPosition(theVehicle) setElementPosition(theVehicle, rx, ry, rz +0.3) end end --- function fix () local theVehicle = getPedOccupiedVehicle (localPlayer) if theVehicle and getVehicleController ( theVehicle ) == localPlayer then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !",255,255,0,true) end end --- function consoleGiveCash () givePlayerMoney (50000 ) end function consoleGiveCash2 () givePlayerMoney (10000 ) end --- Show.dX_ = function() Show.dx = (not Show.dx) removeEventHandler("onClientRender",root, dx) if (Show.dx) then addEventHandler("onClientRender",root, dx) end end function gui( ) guiSetVisible (GUIEditor.window[1],not guiGetVisible (GUIEditor.window[1])) showCursor (guiGetVisible (GUIEditor.window[1])) Show.dX_() end Nothing again...
Fox261098 Posted May 15, 2016 Author Posted May 15, 2016 what is error? There arent errors now but gui is not openning
BEN. Posted May 15, 2016 Posted May 15, 2016 https://wiki.multitheftauto.com/wiki/BindKey this example bind key to open gui on F3 bindKey("F3","down", function() local key = (not guiGetVisible(GUIEditor.window[1])) guiSetVisible(GUIEditor.window[1],key) showCursor(key) end)
Fox261098 Posted May 15, 2016 Author Posted May 15, 2016 https://wiki.multitheftauto.com/wiki/BindKeythis example bind key to open gui on F3 bindKey("F3","down", function() local key = (not guiGetVisible(GUIEditor.window[1])) guiSetVisible(GUIEditor.window[1],key) showCursor(key) end) where to put that
swedishboy Posted May 15, 2016 Posted May 15, 2016 GUIEditor = {button = {},window = {},edit = {}} Show = {} addEventHandler("onClientResourceStart", resourceRoot, function () GUIEditor.window[1] = guiCreateWindow(0, 4, 544, 413, "Mini admin panel.By LuckyDude", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF7F7F7F") GUIEditor.edit[1] = guiCreateEdit(9, 266, 510, 126, "This is a new mini adminpanel.Made by LuckyDude", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(15, 29, 242, 82, "Flip Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") GUIEditor.button[2] = guiCreateButton(15, 183, 242, 73, "Fix Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") GUIEditor.button[3] = guiCreateButton(282, 29, 242, 73, "50k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") GUIEditor.button[5] = guiCreateButton(287, 183, 242, 73, "10k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], "sa-header") addCommandHandler ("mini",gui) guiSetVisible (GUIEditor.window[1], false) --- Events addEventHandler("onClientGUIClick", GUIEditor.button[1], flip, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], fix, false) addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash, false) addEventHandler("onClientGUIClick", GUIEditor.button[5], consoleGiveCash2, false) end) --- function dx() dxDrawText("Race Admin Panel", 60, 431, 501, 574, tocolor(0, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(60, 495, 435, 495, tocolor(60, 251, 16, 255), 4, false) end --- function flip ( ) local theVehicle = getPedOccupiedVehicle (localPlayer ) if ( theVehicle and getVehicleController ( theVehicle ) == localPlayer ) then local rx, ry, rz = getElementPosition(theVehicle) setElementPosition(theVehicle, rx, ry, rz +0.3) end end --- function fix () local theVehicle = getPedOccupiedVehicle (localPlayer) if theVehicle and getVehicleController ( theVehicle ) == localPlayer then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !",255,255,0,true) end end --- function consoleGiveCash () givePlayerMoney (50000 ) end function consoleGiveCash2 () givePlayerMoney (10000 ) end --- Show.dX_ = function() Show.dx = (not Show.dx) removeEventHandler("onClientRender",root, dx) if (Show.dx) then addEventHandler("onClientRender",root, dx) end end function gui( ) guiSetVisible (GUIEditor.window[1],not guiGetVisible (GUIEditor.window[1])) showCursor (guiGetVisible (GUIEditor.window[1])) Show.dX_() end Nothing again... This code Edited by Oskar should work.. make sure you write /mini and not /Mini
Fox261098 Posted May 15, 2016 Author Posted May 15, 2016 GUIEditor = {button = {},window = {},edit = {}} Show = {} addEventHandler("onClientResourceStart", resourceRoot, function () GUIEditor.window[1] = guiCreateWindow(0, 4, 544, 413, "Mini admin panel.By LuckyDude", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF7F7F7F") GUIEditor.edit[1] = guiCreateEdit(9, 266, 510, 126, "This is a new mini adminpanel.Made by LuckyDude", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(15, 29, 242, 82, "Flip Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") GUIEditor.button[2] = guiCreateButton(15, 183, 242, 73, "Fix Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") GUIEditor.button[3] = guiCreateButton(282, 29, 242, 73, "50k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") GUIEditor.button[5] = guiCreateButton(287, 183, 242, 73, "10k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], "sa-header") addCommandHandler ("mini",gui) guiSetVisible (GUIEditor.window[1], false) --- Events addEventHandler("onClientGUIClick", GUIEditor.button[1], flip, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], fix, false) addEventHandler("onClientGUIClick", GUIEditor.button[3], consoleGiveCash, false) addEventHandler("onClientGUIClick", GUIEditor.button[5], consoleGiveCash2, false) end) --- function dx() dxDrawText("Race Admin Panel", 60, 431, 501, 574, tocolor(0, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(60, 495, 435, 495, tocolor(60, 251, 16, 255), 4, false) end --- function flip ( ) local theVehicle = getPedOccupiedVehicle (localPlayer ) if ( theVehicle and getVehicleController ( theVehicle ) == localPlayer ) then local rx, ry, rz = getElementPosition(theVehicle) setElementPosition(theVehicle, rx, ry, rz +0.3) end end --- function fix () local theVehicle = getPedOccupiedVehicle (localPlayer) if theVehicle and getVehicleController ( theVehicle ) == localPlayer then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !",255,255,0,true) end end --- function consoleGiveCash () givePlayerMoney (50000 ) end function consoleGiveCash2 () givePlayerMoney (10000 ) end --- Show.dX_ = function() Show.dx = (not Show.dx) removeEventHandler("onClientRender",root, dx) if (Show.dx) then addEventHandler("onClientRender",root, dx) end end function gui( ) guiSetVisible (GUIEditor.window[1],not guiGetVisible (GUIEditor.window[1])) showCursor (guiGetVisible (GUIEditor.window[1])) Show.dX_() end Nothing again... This code Edited by Oskar should work.. make sure you write /mini and not /Mini Man i said the gui is not showing up
swedishboy Posted May 15, 2016 Posted May 15, 2016 I tested it now and works perfect, then you added the script server-side and not client-side
Fox261098 Posted May 15, 2016 Author Posted May 15, 2016 I tested it now and works perfect, then you added the script server-side and not client-side Thanks man ye u was right
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