-
Posts
253 -
Joined
-
Last visited
Everything posted by Miika
-
Or you could avoid cancer code like that and simply not name your function "createPed". Yeah, i renamed the function.
-
Oops, same mistake always But thanks guy for helping!
-
Do you have event added in client side?
-
You cannot run client functions in serverside script.
-
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 )
-
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.
-
It works! Thx.
-
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 )
-
Thanks GTX, it's working perfectly!
-
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
-
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.
-
This topic maybe help you: https://forum.multitheftauto.com/viewtopic.php?f=91&t=58918&p=561437
-
OnClientGUIClick GuiCreateWindow
-
Oh, thx dude! It works.
-
-- PROBLEM SOLVED AND CODE REMOVED--
-
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!
-
You need server and client side. They didn't work at once.
-
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)
-
Can you post bad arguments in here?
-
Maybe you need to check wiki
-
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]])
-
Yes, if you use createVehicle on client side.