Jump to content

..:D&G:..

Members
  • Posts

    1,028
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ..:D&G:..

  1. Doesn't work... and there are also no errors..
  2. Hello peeps, I want to make a simple sound script for an interior, so there is 1 song playing and looping. function playCasinoMusic() sound = playSound3D("cazinomusic.mp3", 2236.4619140625, 1631.5, 1008.359375, true) if sound then setElementDimension(sound, 806) setElementInterior(sound, 1) setSoundVolume(sound, 70) setSoundMaxDistance(sound, 100) end end addEventHandler("onClientResourceStart", getRootElement(), playCasinoMusic) The problem is that the sound stars playing, like 2-3 times on top of each other... Any ideas?
  3. Doesn't work... Maybe the eventHandler is wrong? addEventHandler ( "onClientGUIClick", donItemsList, selectedImage )
  4. This is the default picture, which shows when no item is selected: donBunuriPic = guiCreateStaticImage(291, 144, 219, 206, "images/default.png", false, donBunuriMain) And the image that needs to show when an item is selected, is for each item in the table: local bunuri = { --Masini {"Infernus", 5, "images/vehicles/infernus.png"}, {"Bullet", 5, "images/vehicles/bullet.png"}, {"Turismo", 5, "images/vehicles/turismo.png"}, {"Super GT", 4, "images/vehicles/supergt.png"}, {"Banshee", 4, "images/vehicles/banshee.png"}, {"Cheetah", 4, "images/vehicles/cheetah.png"}, {"Hotring Racer", 3, "images/vehicles/hotring.png"}, {"Hotring Racer 2", 3, "images/vehicles/hotrina.png"}, {"Hotring Racer 3", 3, "images/vehicles/hotrinb.png"}, }
  5. Use this, and make sure that I placed your image path correctly!... function selectedImage (button) if (button == "left" ) then if (source == donBunuriList) then currentImage = guiGridListGetItemText ( donBunuriList, guiGridListGetSelectedItem ( donBunuriList ), 1 ) if ( donBunuriPic ) then if guiStaticImageLoadImage ( donBunuriPic, ..yourPreferredImage.. ) == false then guiStaticImageLoadImage ( donBunuriPic, ..yourimage.. ) end else currentImage = guiCreateStaticImage(291, 144, 219, 206, v[3], false, donBunuriMain) end end end addEventHandler( "onClientGUIClick", donBunuriList, selectedImage ) end How is this even supposed to work? "v[3]" will be nill and the 4th if makes no sense, anyway it doesn't work, but thanks for trying to help me.
  6. Careful, Windows defender says that the included zip file contains a virus of some sort, use Linux to view it safely. ... Kinda too late, don't you think?
  7. Looks like a mta admin hack https://community.multitheftauto.com/index.php?p= ... s&id=11683
  8. I got to a point where, when I click an item from the gridlist, it gets the 8th item only, and when I click another item, it doesn't change... addEventHandler ( "onClientGUIClick", getRootElement(), function (button, state) if(button == "left") then if(donBunuriPic) then destroyElement(donBunuriPic) donBunuriPic = nil end if(source == donBunuriList) then if(guiGetVisible(donBunuriMain)) then local row, column = nil local row_temp, column_temp = guiGridListGetSelectedItem ( source ) if((row == nil) and (row_temp)) then row = row_temp column = column_temp donBunuriPic = guiCreateStaticImage(291, 144, 219, 206, v[3], false, donBunuriMain) end end end end end end)
  9. I tried this: local item = guiGridListGetSelectedItem (donItemsList) guiStaticImageLoadImage(donItemPic, item.v[3]) But it doesn't get the "item" and the text, picture and only 1 item is displayed in the gridlist..
  10. I tried this but it doesn't destroy the default picture(cover picture) nor create a new one... for i, v in ipairs(items) do local row = guiGridListAddRow(donItemsList) guiGridListSetItemText(donBunuriList, row, donItemsName, v[1], false, false) guiGridListSetItemText(donBunuriList, row, donItemsPret, v[2]..".00 €", false, false) local item = guiGridListGetSelectedItem (donItemsList) local donItem = guiGridListGetItemText(donItemsList, item, 1) destroyElement(donItemsPic) donItemsPic = guiCreateStaticImage(291, 144, 219, 206, "images/"..donBun..".png", false, donItemsMain) end
  11. Hello guys, I am trying to make a gridlist with items, and when the player clicks a row with lets say "Item1", the image from the left size of the gridlist, is updated with a value from the table: local items = { {"Infernus", 5, "vehicles/infernus.png"}, {"Bullet", 3, "vehicles/bullet.png"}, } for i, v in ipairs(items) do local row = guiGridListAddRow(donItemsList) guiGridListSetItemText(donItemsList, row, donItemsName, v[1], false, false) guiGridListSetItemText(donItemsList, row, donItemsPrice, v[2]..".00 €", false, false) end I don't know how to update the picture and and to get the picture of the selected item... Thanks.
  12. Hello guys, I am trying to add rows with info in a gridlist from a table, but I don't really know how to do it... local items = { {"Infernus", 2}, } donItemsList = guiCreateGridList(24, 98, 257, 351, false, mainWindow) donBItemName = guiGridListAddColumn(donItemsList, "Item Name", 0.9) guiGridListAddRow(donItemsList) guiGridListSetItemText(donItemsList, 0, 1, "Item 1", false, false) The "2" means that the "Infernus" item will be on the second tab from the gridlist. Thanks.
  13. The server and client use 1.4.1, and I tried soo many times to make it work, but it doesn't...
  14. Hello guys, I am trying to set the speed for trams using setTrainSpeed and with 0.1 but it still goes over 180... I want the tram to have a maximum speed of 80 Thanks
  15. Hello guys, I am trying to add a battery system to my vehicles script, and I want to get when the player tuns on the engine of the vehicle, so I can decrease the battery voltage. Thanks.
  16. I tried to make all the .pngs from the txd's at least half their size, but every time I upload the txd, the car is white and I get the error: "Error loading TXD" Any ideas how to fix it? Edit!! Fixed it, it was because I used invalid sizes. But it still lags even when the txd gets from 14MB to 100KB... Any ideas?
  17. Hello guys, I keep seeing servers with tons and tons of mods, and with very little lag with a shitty host, but still manage to get less lag. So, what can I do to make the mods I put on my server less laggy? Do I need to edit the textures or something?
  18. Doesn't work... it still says "table expected got nil"
  19. Hello, I am trying to get cars from a table and output them as rows in a gui. The table "local vehicleTable = { }" is at the top of the code, but it still says that the ipairs thing expects a table but got nil... Any ideas? Here is the code: for key, value in ipairs(vehicleTable) do local carID = getElementData(value, "WGRPG.carID") local row = guiGridListAddRow(gVehs) guiGridListSetItemText(gVehs, row, col, getVehicleName(value), false, false) guiGridListSetItemText(gVehs, row, IDcolumn, tostring(carID), false, false) end
  20. Hello guys, I got some problems with getSlotFromWeapon, it says that weapon-type was expected at argument 1, but got 47 (which is the weapon id) even in the wiki it says that the argument 1 should be the weapon id, not weapon type... function checkPlayerWeapons() for i = 1, 47 do if i ~= 40 then local weapSlot = i == 15 and 10 or getSlotFromWeapon(i) if getPedWeapon(localPlayer, weapSlot) == i then local ammo = getElementData(localPlayer, "safeWeapon" .. i) or 0 if ammo < 0 then ammo = 0 setElementData(localPlayer, "safeWeapon" .. i, 0, false) end
  21. Hello guys, is there any way to put the car window up and down like in the driveby resource? I've looked into the resource but I couldn't see nothing that was related to a car window
×
×
  • Create New...