Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. Try this, although I haven't tested it. function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end GUIEditor = { button = {}, staticimage = {} } function createGUI ( ) if ( isElement ( sfpay ) ) then destroyElement ( sfpay ) else sfpay = guiCreateButton(176, 294, 150, 35, "San Fierro Pay And Spray", false) guiSetFont(sfpay, "default-bold-small") end if ( isElement ( oldg ) ) then destroyElement ( oldg ) else oldg = guiCreateButton(734, 410, 150, 35, "San Fierro Old Garage", false) guiSetFont(oldg, "default-bold-small") end if ( isElement ( mc ) ) then destroyElement ( mc ) else mc = guiCreateButton(554, 470, 150, 35, "mc", false) guiSetFont(mc, "default-bold-small") end if ( isElement ( trans ) ) then destroyElement ( trans ) else trans = guiCreateButton(365, 470, 150, 35, "San Fierro Trans Fender", false) guiSetFont(trans, "default-bold-small") end if ( isElement ( Bay ) ) then destroyElement ( Bay ) else Bay = guiCreateButton(554, 410, 150, 35, "Bay", false) guiSetFont(Bay, "default-bold-small") end if ( isElement ( Bridge ) ) then destroyElement ( Bridge ) else Bridge = guiCreateButton(365, 294, 150, 35, "Bridge", false) guiSetFont(Bridge, "default-bold-small") end if ( isElement ( Las ) ) then destroyElement ( Las ) else Las = guiCreateButton(176, 410, 150, 35, "Johnson House", false) guiSetFont(Las, "default-bold-small") end if ( isElement ( Airstrip ) ) then destroyElement ( Airstrip ) else Airstrip = guiCreateButton(176, 470, 150, 35, "Abanded Airport Garage", false) guiSetFont(Airstrip, "default-bold-small") end if ( isElement ( eightball ) ) then destroyElement ( eightball ) else eightball = guiCreateButton(176, 351, 150, 35, "Eight Ball Autos", false) guiSetFont(eightball, "default-bold-small") end if ( isElement ( gfr ) ) then destroyElement ( gfr ) else gfr = guiCreateButton(365, 351, 150, 35, "Michells Repair", false) guiSetFont(gfr, "default-bold-small") end if ( isElement ( map ) ) then destroyElement ( map ) else map = guiCreateButton(365, 410, 150, 35, "yolo", false) guiSetFont(map, "default-bold-small") end if ( isElement ( test1 ) ) then destroyElement ( test1 ) else test1 = guiCreateButton(365, 539, 150, 35, "test1", false) guiSetFont(test1, "default-bold-small") end if ( isElement ( test2 ) ) then destroyElement ( test2 ) else test2 = guiCreateButton(554, 539, 150, 35, "test2", false) guiSetFont(tes2, "default-bold-small") end if ( isElement ( sfoldbig ) ) then destroyElement ( sfoldbig ) else sfoldbig = guiCreateButton(176, 539, 150, 35, "San Fierro Old Garage Big", false) guiSetFont(sfoldbig, "default-bold-small") end if ( isElement ( test3 ) ) then destroyElement( test3 ) else test3 = guiCreateButton(734, 539, 150, 35, "test3", false) guiSetFont(test3, "default-bold-small") end if ( isElement ( closepanel ) ) then destroyElement ( closepanel ) else closepanel = guiCreateButton(734, 462, 144, 62, "Close", false) end if ( isElement ( GUIEditor.staticimage[1] ) ) then destroyElement ( GUIEditor.staticimage[1] ) else GUIEditor.staticimage[1] = guiCreateStaticImage(554, 195, 324, 180, ":dxopen/images/jjlogo.png", false) end end addCommandHandler("garage", createGUI ) addEventHandler("onClientRender", root, function() dxDrawRectangle(156, 184, 732, 501, tocolor(0, 0, 0, 100), false) dxDrawText("JJ's garage Panel", 237, 227, 642, 361, tocolor(0, 0, 0, 255), 1.20, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("JJ's garage Panel", 232, 227, 515, 294, tocolor(255, 255, 0, 170), 1.20, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Made By ToffBrown", 365, 619, 684, 660, tocolor(29, 238, 39, 139), 1.00, "bankgothic", "left", "top", false, false, true, false, false) end ) addEventHandler("onClientRender",root,dxWindow) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == sfpay) then triggerServerEvent("switchsf1", getRootElement()) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == trans) then triggerServerEvent("switchsf2", getRootElement()) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == oldg) then triggerServerEvent("oldgarage1", getRootElement()) end end )
  2. You can use: createObject moveObject createMarker -- Event: onMarkerHit
  3. Try this: dbExec(server, "CREATE TABLE IF NOT EXISTS accounts (accountname TEXT, password TEXT)") function submitReg( inputusernamereg, inputpasswordreg ) dbExec(server, "INSERT INTO accounts (accountname, password) VALUES (?,?)", tostring ( inputusernamereg ), tostring ( inputpasswordreg ) ) outputChatBox("You have successfully created an account!", source) triggerClientEvent(source, "closedok", source ) triggerClientEvent(source, "onclose", source ) end If it doesn't work, post your database connection. When you're using database functions, it's better to use "VALUES ( ?, ?, ... )"
  4. Here is an MTA hosting list: https://mtasa.com/hosters/
  5. Use: if sx and sy and sz then ... code .... end
  6. Check community first. https://community.multitheftauto.com/index.php?p= ... ls&id=3016
  7. Hi guys. (Sorry if this is wrong section) For some reason, when I put a lot of text into a memo, it starts to bug out. The position of the cursor is set on the memo is bugged for some reason (if that makes much scene.) It puts random spaces in when I highlight, but when it's not highlighted, it just edits the wrong area.
  8. It would be better to use variables. DX functions don't return elements anyway.
  9. Not really sure why your code isn't working, but you can try this one: addEventHandler ( "onPlayerWasted", root, function ( _, p ) if ( p and isElement ( p ) and p ~= source ) then exports['exp_system']:addPlayerEXP ( p, 25 ) end end )
  10. Needed to change "ipairs" to "pairs." local tables = { [1]={-2421.69238, -582.35858, 133.61719, "Caine"}, } function renderIng() local x, y, z = getCameraMatrix( ) for ID,v in pairs(tables) do local px, py, pz = tables[ID][1], tables[ID][2], tables[ID][3] local distance = getDistanceBetweenPoints3D( px, py, pz, x, y, z ) if distance <= 20 then local text = tables[ID][4] if text and ( distance < 2 or isLineOfSightClear( x, y, z, px, py, pz + 0.7, true, true, true, true, false, false, true, localPlayer ) ) then local sx, sy = getScreenFromWorldPosition( px, py, pz + 0.7 ) if sx and sy then local w = dxGetTextWidth( tostring( text ) ) local h = ( text and 2 or 1 ) * dxGetFontHeight( ) dxDrawText( tostring( text ), sx, sy, sx, sy, tocolor( 255, 255, 255, 255 ), 1, "default", "center", "center" ) end end end end end addEventHandler( "onClientRender", getRootElement( ),renderIng)
  11. You forgot to end the if statement and function. function greetings() local joinedPlayerName = getPlayerName ( source ) if ( joinedPlayerName == 'mike' ) then outputChatBox( "Welcome Mike!" ) end end addEventHandler ( "onPlayerJoin", getRootElement(), greetings )
  12. Next update, but did it with a reason. Because of noobs stealing it, decomplining it, etc, etc. As long as it's encrypted, it cannot be decompiled, as for there is no decompiler for encryptions yet.
  13. Chronic, if this hasn't been solved yet, go head and post your meta.xml please.
  14. Its cool, but wouldn't it just be easier to use lua?
  15. I use USBWebHost. You can google it. (PS SQLite and MySQL use the same execution atrings.)
  16. Mysql is a server, and SQLite is basically a the same thing but a file... if you're looking for a program to host it. I would just use sqlite.
  17. Use SELECT * FROM mapy WHERE map=\""..mapName.."\"
  18. MySQL is a database language, used to save information. Google mysql on how to learn it. Do you know what you're even talking about?
  19. 0 isn't nil, "Stats" is returning nil.
  20. To give it rights, open up console and type "aclrequest". GUI Editor is designed to create GUI elements and DX functions, it's not good for scripting.
  21. GUI Editor is the best resource that you'll find to create a GUI.
  22. xXMADEXx

    Editbox

    gsub is part of string.gsub... It will find arg1 (In this case " ") and replace it with arg2 (In this case ""). In this script, it will remove all the spaces. http://www.lua.org/manual/5.1/manual.ht ... tring.gsub
×
×
  • Create New...