Jump to content

FlorjanMTARP

Members
  • Posts

    56
  • Joined

  • Last visited

Everything posted by FlorjanMTARP

  1. What was the problem If I may ask? I am also working on a similar browser but the video never starts from youtube.-.
  2. FlorjanMTARP

    MTA 1.4

    Happens to me either! This will probably get fixed in the upcoming version of MTA.
  3. Lately I was messing with gui editor and I have figured out an awesome idea. The only problem is I don't know how to deal with it. What I want to do: I've made a gui with Tab Panels "Types of Horns" , won't say them all. Well, I want to allow players to buy a horn and once they buy it it will setElementData that the system knows that he bought it. Means, If he reconnects he will still have that one. I JUST NEED AN EXAMPLE, NOR A COMPLETE SCRIPT! Don't worry about sounds, Just if you are willing to edit my code below please write everything. I know how to edit stuff and also deal with stuff GUIEditor = { tab = {}, staticimage = {}, tabpanel = {}, label = {}, button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(286, 183, 798, 473, "StoryRoam - Horn Shop", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF9100") GUIEditor.staticimage[1] = guiCreateStaticImage(10, 19, 259, 98, ":SRcameras/STORYROAMLOGO.png", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(8, 118, 271, 209, "Information:\n\nThe StoryRoam's horn shop is another cool\n feature which allows you to spend money\n on cool and funny horns.\n You can have fun with your friends or just beep\n all over the map \"{SMILIES_PATH}/icon_smile.gif\" alt=\"\" title=\"Smile\" />\n\nThe list next to this text is a list of available horns\n. Each horn has It's lenght and\n the lenght depends on the\n price.\n\nHave fun!", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 255, 145, 0) GUIEditor.tabpanel[1] = guiCreateTabPanel(283, 23, 505, 440, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Loud Horns", GUIEditor.tabpanel[1]) GUIEditor.button[1] = guiCreateButton(12, 398, 103, 18, "", false, GUIEditor.tab[1]) GUIEditor.button[2] = guiCreateButton(26, 27, 120, 55, "AFRO CIRCUS", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") GUIEditor.button[3] = guiCreateButton(132, 55, 68, 15, "", false, GUIEditor.button[2]) GUIEditor.button[4] = guiCreateButton(190, 27, 121, 55, "AAAAAAAA", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[4], "default-bold-small") GUIEditor.button[5] = guiCreateButton(363, 29, 119, 53, "GTASA Song", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[5], "default-bold-small") GUIEditor.tab[2] = guiCreateTab("Funny Horns", GUIEditor.tabpanel[1]) GUIEditor.button[6] = guiCreateButton(27, 21, 121, 50, "HAH GAY!", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.button[6], "default-bold-small") GUIEditor.button[7] = guiCreateButton(186, 21, 124, 50, "BARBIE GIRL", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.button[7], "default-bold-small") GUIEditor.button[8] = guiCreateButton(361, 21, 113, 50, "SEXY MAN", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.button[8], "default-bold-small") GUIEditor.tab[3] = guiCreateTab("Animal Horns", GUIEditor.tabpanel[1]) GUIEditor.button[9] = guiCreateButton(32, 26, 131, 53, "COW", false, GUIEditor.tab[3]) guiSetFont(GUIEditor.button[9], "default-bold-small") GUIEditor.button[10] = guiCreateButton(205, 25, 135, 54, "DOG", false, GUIEditor.tab[3]) guiSetFont(GUIEditor.button[10], "default-bold-small") GUIEditor.button[11] = guiCreateButton(376, 24, 111, 55, "CHICKEN", false, GUIEditor.tab[3]) guiSetFont(GUIEditor.button[11], "default-bold-small") GUIEditor.tab[4] = guiCreateTab("Music Horns", GUIEditor.tabpanel[1]) GUIEditor.button[12] = guiCreateButton(35, 28, 132, 57, "CALL ME MAYBE", false, GUIEditor.tab[4]) guiSetFont(GUIEditor.button[12], "default-bold-small") end ) Peace up!
  4. I've been dealing with this guiSetVisible for 30min .
  5. I removed it because when It was wrote, The GUI was just showing all the time. So there weren't any solutions and I've also tried renaming the marker, probably. I want it to popup onClientMarkerHit. <- Not to be rude
  6. Please before you comment stuff, you should know that I am 13 years old and I'm a web programmer (decent) HTML,CSS and PHP. I want to get to known Lua since I'm also helping my friend make a server. I've used GUI Editor to make a GUI for an upcoming Garage System and when I enter the marker nothing shows up. No errors, No outputs, nothing. --[[------------------------------------------------- Notes: > This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. --]]------------------------------------------------- marker = createMarker(-2547.4677734375, 648.90625, 26.8125, "cylinder", 2, 255, 145, 0, 255) GUIEditor.window[1] = guiCreateWindow(393, 175, 584, 428, "StoryRoam - Garage System", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF9100") GUIEditor.staticimage[1] = guiCreateStaticImage(13, 23, 142, 146, ":SRhousing/images/script/house_.png", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(163, 37, 402, 16, "Here you may buy a garage and store your vehicles inside it.", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 255, 145, 0) GUIEditor.label[2] = guiCreateLabel(162, 54, 403, 18, "There is no annoying confirm buttons so It's simple to buy a garage!", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 255, 145, 0) GUIEditor.label[3] = guiCreateLabel(160, 72, 405, 15, "If you are interested in buying a garage then just click buttons below. \"{SMILIES_PATH}/icon_smile.gif\" alt=\"\" title=\"Smile\" />", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 255, 145, 0) GUIEditor.label[4] = guiCreateLabel(156, 86, 409, 15, "___________________________________________________________________________________", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetColor(GUIEditor.label[4], 255, 145, 0) GUIEditor.label[5] = guiCreateLabel(52, 169, 143, 15, "Information", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetColor(GUIEditor.label[5], 255, 145, 0) GUIEditor.label[6] = guiCreateLabel(20, 186, 140, 219, "\nType: Regular Garage\n\nPrice: 45,000$\n\nCapacity: 2 Vehicles\n____________________________________\n", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[6], "default-bold-small") guiLabelSetColor(GUIEditor.label[6], 255, 145, 0) GUIEditor.button[1] = guiCreateButton(13, 361, 157, 29, "Buy Garage", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF9100") GUIEditor.button[2] = guiCreateButton(195, 359, 180, 31, "Exit", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF9100") GUIEditor.button[3] = guiCreateButton(388, 359, 167, 31, "Enter the garage", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFF9100") GUIEditor.staticimage[2] = guiCreateStaticImage(421, 288, 93, 61, ":SRhousing/images/script/icon_enter.png", false, GUIEditor.window[1]) GUIEditor.staticimage[3] = guiCreateStaticImage(47, 295, 85, 56, ":SRhousing/images/script/icon_buy.png", false, GUIEditor.window[1]) GUIEditor.staticimage[4] = guiCreateStaticImage(235, 296, 90, 47, ":SRhousing/images/script/icon_destroy.png", false, GUIEditor.window[1]) GUIEditor.label[7] = guiCreateLabel(154, 99, 16, 174, "|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[7], "default-bold-small") guiLabelSetColor(GUIEditor.label[7], 255, 145, 0) GUIEditor.label[8] = guiCreateLabel(159, 99, 406, 164, "\n\nQuestions & Answers\n\n-Why would I buy a garage?\nTo store your vehicles and have them safe \"{SMILIES_PATH}/icon_smile.gif\" alt=\"\" title=\"Smile\" />\n-Do I get refunds If I buy it by accident?\nOfcourse you do!\n-Will I receive any rewards for reporting bugs?\nYes, You will be money rewarded or anything.", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[8], "default-bold-small") guiLabelSetColor(GUIEditor.label[8], 255, 145, 0) function close() if (source == GUIEditor.button[2]) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end addEventHandler("onClientGUIClick", GUIEditor.button[2], close) function showgui (hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, showgui) function showguil (leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, showguil) peace... It's client sided.
  7. I know tosfera and thanks Solidsnake. Tosfera I made some cool scripts already and I want to work better from now. Thanks giuseppe.
  8. Thank you Solidsnake, I appreciate yourhelp. AND ALSO Thanks Saml1er. EDIT) It does nothing ingame when I use LMB or RMB on another player. I've set it clientsided.
  9. Saml1er thank you but do I have to create the ped firstly?
  10. I was wondering for the past few days, how to make a GUI show up when you right click a ped? Are there any resources samples? Sincerely, Florjan.
  11. Well title says it. The first GUI that shows in marker; --------------------------||Open Source||-------------------------- ------------------------------------------------------------------- function createHauptGUI() local X = 0.3 local Y = 0.7 local Width = 0.4 local Height = 0.17 HauptGUI = guiCreateWindow(X, Y, Width, Height,"Garage Menu", true) X = 0.5 Y = 0.5 Width = 0.45 Height = 0.4 btnmyGarages = guiCreateButton(X, Y, Width, Height, "Own Garage", true, HauptGUI) X = 0.03 Y = 0.5 Width = 0.45 Height = 0.4 btnfreeGarages = guiCreateButton(X, Y, Width, Height, "Not Owned Garages", true, HauptGUI) X = 0.9 Y = 0.3 Width = 0.05 Height = 0.15 btnclose = guiCreateButton(X, Y, Width, Height, "X", true, HauptGUI) addEventHandler("onClientGUIClick", btnmyGarages, cmyGUI, false) addEventHandler("onClientGUIClick", btnfreeGarages, cfreeGUI, false) addEventHandler("onClientGUIClick", btnclose, clientHauptclose, false) end function cmyGUI() guiSetVisible(HauptGUI, false) triggerServerEvent ( "onmyGUI", localPlayer) end function cfreeGUI() guiSetVisible(HauptGUI, false) triggerServerEvent ( "onfreeGUI", localPlayer) end function clientHauptclose() guiSetVisible(HauptGUI, false) setCameraTarget ( localPlayer ) setElementFrozen ( localPlayer, false ) setPlayerHudComponentVisible ( "radar", true ) end function clientbuy(thePlayer) Index, b =guiGridListGetSelectedItem ( Garagenliste ) triggerServerEvent ( "buy",localPlayer, Index ) end function cHauptGUI() createHauptGUI(thePlayer) setCameraMatrix(1631.8000488281, -1070.9000244141, 41, 1593, -1026, 30) setElementFrozen ( localPlayer, true ) setPlayerHudComponentVisible ( "radar", false ) end addEvent( "onMarkerHit", true ) addEventHandler( "onMarkerHit" ,getRootElement(), cHauptGUI, thePlayer) If you want other GUIs just tell me in the topic.
  12. It still doesn't go up, neither down. I get in the marker and nothing happens. No errors and stuff. server: local gate = createObject(17951, 1556.36, -2348.79, 13.54, 0, 0, 180) local marker = createMarker(1554, -2348.79, 12.54, "cylinder", 2, 255, 255, 255, 255) local garage = createObject(17950, 1560.36, -2348.79, 13.54, 0, 0, 90) addEventHandler ( 'onPlayerMarkerHit', marker, function ( ) if ( getAccountName(getPlayerAccount(source)) == 'Florjan22') then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end ) addEventHandler ( 'onPlayerMarkerLeave', marker, function ( ) if ( getAccountName(getPlayerAccount(source)) == 'Florjan22') then moveObject(gate, 5000, 1556.36, -2348.79, 13.54) end end )
  13. It does nothing doesn't work, I go in marker and I'm logged in and won't work. local gate = createObject(17951, 1556.36, -2348.79, 13.54, 0, 0, 180) local marker = createMarker(1554, -2348.79, 12.54, "cylinder", 2, 255, 255, 255, 255) local garage = createObject(17950, 1560.36, -2348.79, 13.54, 0, 0, 90) function moveGate() if getAccountName(getPlayerAccount(source)) == "Florjan22" then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end addEventHandler("onPlayerMarkerHit", marker, moveGate) function moveBack() if getAccountName(getPlayerAccount(source)) == "Florjan22" then moveObject(gate, 5000, 1556.36, -2348.79, 13.54) end end addEventHandler("onPlayerMarkerHit", marker, moveBack)
  14. Client; local gate = createObject(17951, 1556.36, -2348.79, 13.54, 0, 0, 180) local marker = createMarker(1554, -2348.79, 12.54, "cylinder", 2, 255, 255, 255, 255) local garage = createObject(17950, 1560.36, -2348.79, 13.54, 0, 0, 90) function moveGate() if getAccountName(getPlayerAccount(player)) == "Florjan22" then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 5000, 1556.36, -2348.79, 13.54) end addEventHandler("onMarkerLeave", marker, moveBack) It doesn't move when I enter the marker
  15. Why would you make it so unique to add a MySQL GetString ?
  16. It hasn't even come out yet. GTA V has GTA Online on the consoles already, It will probably support the PC,PS4 and Xbox One too..
  17. Thank you, Maybe I will give out some media.
  18. Good then. I've succesfully done the whole script and I'm probably not going to publish it to public since players edit the meta.xml and claim they made it. -Florjan
  19. This is not an advertisement so stop debating about it.
  20. We know, We figured out we took their name like a day ago and we're having unique ideas on what should be our next name!
  21. I have never tried that yet. Anyone else could give me any more information about such?
  22. It is a copy of Valhalla RP. We are making a complete new unique system. Cody@ Thanks! That's a great one, I know TEDERIs Thats not the point, the point is you and the other server will get mixed up all the time, and its common curtosy to not use the same name for a server as someone else. I know. I want to be clear, we bought the domain and we aren't completely the same. If the existing MTARP is going to have problems with us, we will deal with them ourselves.
  23. It is a copy of Valhalla RP. We are making a complete new unique system. Cody@ Thanks! That's a great one, I know TEDERIs
  24. Well, I need some assistance. I've been recently doing a furniture system and I've done alot. But now the time comes when I want to make specific building areas where only owner of areas can build. For now I've only add a command to open GUI and add objects, delete objects command and cursor command. This are the scripts: GUI function handler(playerSource, commandName) spawn = true use = 0 local gui = getElementsByType("gui-window") for key,guiElement in ipairs(gui) do guiSetVisible ( guiElement, false ) end showCursor ( false ) row, column = guiGridListGetSelectedItem ( list ) name = guiGridListGetItemText ( list, row, 1 ) id = name playerSource = getLocalPlayer() if spawn == true then if id ~= "" then triggerServerEvent ( "addObjectserv", getRootElement(), playerSource, commandName, id ) end end end function startGui(gui) x,y = guiGetScreenSize () y = y / 2 - 235 x = x - 500 showCursor ( true ) GUIEditor_Window = {} buttonmain = {} GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} gui = guiCreateWindow(x,y,405,536,"MTARP - Furniture System",false) button = guiCreateButton(0.08780487626791,0.89552241563797,0.32682925462723,0.072761192917824,"Add",true,gui) button2 = guiCreateButton(0.51707315444946,0.89925372600555,0.32195121049881,0.067164182662964,"Quit",true,gui) list = guiCreateGridList(0.043902438133955,0.02985074557364,0.91219514608383,0.82276117801666,true,gui) addEventHandler ( "onClientGUIClick", button, handler ) addEventHandler ( "onClientGUIClick", button2, cancel ) guiGridListSetSelectionMode(list,2) guiGridListAddColumn(list,"ID",0.40) guiGridListAddColumn(list,"Name",0.9) node = xmlLoadFile("models.xml") for i = 0,24 do subnode = xmlFindSubNode(node,"model", i) id = xmlNodeGetAttribute(subnode,"id") name = xmlNodeGetAttribute(subnode, "name") row = guiGridListAddRow ( list ) guiGridListSetItemText ( list, row, 1, tostring(id), false, false ) guiGridListSetItemText ( list, row, 2, tostring(name), false, false ) end end addEvent("addObject", true) addEventHandler("addObject", getRootElement(), startGui, gui) Object placement use = 0 gui = 1 function delete(source) show = 1 showCursor ( source, true) end function obscurename(mouseButton, buttonState, playerWhoClicked,clickPosX,clickPosY,clickPosZ) if show == 1 then destroyElement(source) show = 0 showCursor ( playerWhoClicked, false) end end function cursorshow(source) show = 0 showCursor ( source, false) end function done(playerSource, key, keyState, id) unbindKey ( playerSource, "arrow_u") unbindKey ( playerSource, "arrow_d") unbindKey ( playerSource, "pgup") unbindKey ( playerSource, "pgdn") unbindKey ( playerSource, "arrow_r") unbindKey ( playerSource, "arrow_l") unbindKey ( playerSource, "mouse_wheel_down") unbindKey ( playerSource, "mouse_wheel_up") unbindKey ( playerSource, "enter") unbindKey ( playerSource, "delete") x,y,z = getElementPosition(object) rx,ry,rz = getObjectRotation(object) file = fileOpen ( "theobjects.lua" ) size = fileGetSize ( file ) fileSetPos(file, size - 98) fileWrite ( file, "\r\n createObject (" .. id .. " , " .. x .. ", " .. y .. " , " .. z .. " , " .. rx .. " , " .. ry .. ", " .. rz .. ") \r\nend \r\n\r\naddEventHandler ( 'onResourceStart', getResourceRootElement(getThisResource()), start )") fileClose ( file ) outputChatBox("Successfully added.", playerSource) use = 0 end function remove(playerSource) use = 0 destroyElement(object) outputChatBox("Object removed", playerSource) unbindKey ( playerSource, "i") unbindKey ( playerSource, "j") unbindKey ( playerSource, "pgup") unbindKey ( playerSource, "pgdn") unbindKey ( playerSource, "k") unbindKey ( playerSource, "l") unbindKey ( playerSource, "mouse_wheel_down") unbindKey ( playerSource, "mouse_wheel_up") unbindKey ( playerSource, "enter") unbindKey ( playerSource, "delete") end function movecar(source, key, keyState) if key == "arrow_u" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y + .5,z ) end if key =="arrow_d" then x,y,z = getElementPosition(object) setElementPosition ( object, x - .5,y,z ) end if key =="arrow_r" then x,y,z = getElementPosition(object) setElementPosition ( object, x + .5,y,z ) end if key =="arrow_l" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y - .5,z ) end if key =="pgup" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y,z + .5 ) end if key =="pgdn" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y ,z - .5 ) end -- rotation -- if key =="mouse_wheel_up" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry,rz - 5 ) end if key =="mouse_wheel_down" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry,rz + 5) end end function triggerGui(playerSource, commandName, id) if use == 0 then use = 1 triggerClientEvent (playerSource, "addObject", getRootElement(), playerSource, commandName) else outputChatBox("object currently being edited", playerSource) end end function carAdd(playerSource, commandName, id) id = id outputChatBox( "controls: Arrows.. mousewheel, pgup, pgdn | enter when done", playerSource, 0, 255) local x,y,z = getElementPosition(playerSource) object = createObject ( id, x + 3,y,z) bindKey(playerSource, "arrow_u", "down", movecar) bindKey(playerSource, "arrow_d", "down", movecar) bindKey(playerSource, "arrow_r", "down", movecar) bindKey(playerSource, "arrow_l", "down", movecar) bindKey(playerSource, "mouse_wheel_up", "down", movecar) bindKey(playerSource, "mouse_wheel_down", "down", movecar) bindKey(playerSource, "enter", "down", done, id) bindKey(playerSource, "delete", "down", remove, playerSource) bindKey(playerSource, "pgup", "down", movecar) bindKey(playerSource, "pgdn", "down", movecar) end addEvent("addObjectserv", true) addEventHandler("addObjectserv", getRootElement(), carAdd) addCommandHandler( "addobject", triggerGui) addCommandHandler( "del", delete) addCommandHandler( "imstupid", cursorshow) addEventHandler( "onElementClicked", getRootElement(), obscurename ) I won't post necessary files like meta,models. ALL I WANT TO MAKE IS AREAS WHERE PEOPLE CAN BUY THEM IF ITS NOT OWNED. IF THE OWNER IS IN HIS AREA HE CAN PLACE OBJECTS. I HAVE ONLY DONE IT SO EVERYONE CAN DELETE EVERYTHING OF ANOTHER PERSON AND PLACE WHEREVER. Please help :- )
×
×
  • Create New...