Jump to content

Miika

Members
  • Posts

    253
  • Joined

  • Last visited

Everything posted by Miika

  1. Or you could avoid cancer code like that and simply not name your function "createPed". Yeah, i renamed the function.
  2. Oops, same mistake always But thanks guy for helping!
  3. Do you have event added in client side?
  4. You cannot run client functions in serverside script.
  5. local sound local stopSound = stopSound_ function startSound () sound = playSound("sounds/sound.mp3") setSoundVolume(sound, 1) end function stopSound() if isElement(sound) then stopSound(sound) end end bindKey ( "w", "down", startSound ) bindKey ( "w", "up", stopSound )
  6. local sound function startSound (killer, weapon, bodypart) sound = playSound("music/music.mp3", true) setSoundVolume(sound, 0.5) end addEventHandler("onClientPlayerWasted", getResourceRootElement(getThisResource()), startSound) function destroySound() if isElement(sound) then destroyElement(sound) end end addEventHandler("onClientPlayerSpawn", getResourceRootElement(getThisResource(), destroySound) Test it.
  7. Hi, I have another problem with ipairs tables: onMarkerHit works only, if i hit second marker from table. No any errors in debugscrpit. [server] jobmarkers = { {-2108.77734375, 144.54998779297, 35.134094238281}; {1642.7379150391, 2354.4382324219, 10.812967300415}; {2452.5341796875, -2119.5114746094, 13.546875}; } for k, v in ipairs (jobmarkers) do local x, y, z = v[1], v[2], v[3] marker = createMarker(x, y, z - 1, "cylinder", 1.5, 255, 255, 0, 150) blip = createBlipAttachedTo(marker, 51) end addEventHandler("onMarkerHit", marker, function(thePlayer) triggerClientEvent(thePlayer, "onTruckerGuiOpen", thePlayer) end )
  8. Thanks GTX, it's working perfectly!
  9. Hi, My mod downloader script replaces only first item from table. This is part of my script: ------{CLIENT}------ [Table] modTable = { --{"Name", "example.txd", "example.dff", "vehicle id", "vehicle to replace"} {"Chevrolet Corvette Sport", "mods/euros.txd", "mods/euros.dff", 587, "Euros"}, {"Nissan Micra 2011 Stance Itasha", "mods/peren.txd", "mods/peren.dff", 404, "Perennial"} } [Replace function] function applymods() local num = 0 for k, v in ipairs (modTable) do local num = num + 1 if (modTable[num]) then if (fileExists(modTable[num][2])) and (fileExists(modTable[num][3])) then -- I have all mods in client folder txd = engineLoadTXD(modTable[num][2]) engineImportTXD(txd, modTable[num][4]) dff = engineLoadDFF(modTable[num][3]) engineReplaceModel(dff, modTable[num][4]) end end end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), applymods) addEventHandler("onClientFileDownloadComplete", getResourceRootElement(getThisResource()), applymods) No any errors in debugscript
  10. Miika

    [HELP] Car

    Vehicle = {} function spawnCars(modelid) if isPedInVehicle(source) then return end if ( Vehicle[source] ) then destroyElement( Vehicle[source] ) -- Destroy it if already created end local playerX,playerY,playerZ = getElementPosition(source) Vehicle[source] = createVehicle(modelid,playerX,playerY, playerZ) -- Creates a new vehicle warpPedIntoVehicle(source,Vehicle[source]) end addEvent("spawn",true) addEventHandler("spawn",root,spawnCars) Test it.
  11. This topic maybe help you: https://forum.multitheftauto.com/viewtopic.php?f=91&t=58918&p=561437
  12. Miika

    [HELP] Button

    OnClientGUIClick GuiCreateWindow
  13. Oh, thx dude! It works.
  14. -- PROBLEM SOLVED AND CODE REMOVED--
  15. I use always this method: local sizeX, sizeY = 400, 500 -- Window size local x, y = guiGetScreenSize() -- get screen size local myGui = guiCreateWindow(x/2-sizeX/2, y/2-sizeY/2, sizeX, sizeY, "My gui", false) -- It's relative!
  16. You need server and client side. They didn't work at once.
  17. function openWindow() if (guiGetVisible(Window_Group) == false) then guiSetVisible(Window_Group, true) if not (isCursorShowing()) then showCursor(true) end else guiSetVisible(Window_Group, false) showCursor(false) end end and put this under gui function: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), Gui) and put this to gui function: guiSetVisible(Window_Group, false)
  18. Can you post bad arguments in here?
  19. Maybe you need to check wiki
  20. It seems like there's no way to make it smaller but you can use createColSphere Example: x, y, z = 0, 0, 0 -- pickup coordinates createPickup(x, y, z, 3, 1273) -- create pickup col = createColSphere(x, y, z, 0.5) -- create col addEventHandler("onColShapeHit", col, --[[Function]])
  21. Yes, if you use createVehicle on client side.
×
×
  • Create New...