-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
I gave you an answer that would give your image a background color. If the answer is not helpful, then your question is incorrect. I also noticed before that your previous comment (hidden) was very toxic and disrespectful. Now you are trying to provoke a: Please behave yourself. LOCKED
-
Use a second label[+] or use a gridlist instead. Put another image behind that. Just use a 1x1 size image with a single color. Disable the image as well, to make sure it doesn't goes in front of the other image.
-
Afaik there is a Mouse up and down state. The second argument.
-
Hmm, not sure. I haven't seen another one. Instead of this, you can also rotate this: dxDrawImage(Radar.posX + Radar.size, Radar.posY, -Radar.size, Radar.size, uMaskShader); Instead of: dxSetShaderValue(uMaskShader, "gUVRotAngle", math.rad(iCameraRotation + 180)); You could also try dxSetBlendMode ("overwrite"). I am not sure if it will overwrite the color or applying negative result and therefore doing the same as an inverted mask. > Never tried that before.
-
You are not the only person that tried to create this. For my projectile I used the basic function: https://wiki.multitheftauto.com/wiki/DxDrawLine Which did indeed work. Created nice quality lines. While doing this project there was 1 wall I hit with project that ended up making it a failure. The map-draw resource required heavily on realtime updates for all 3 dimensions: x, y and z. Depending on the height of the camera, the order and opacity for each element was adjusted. This was required because the maps did also have multiple (building) floor. Which ended up in too many draws on a single rendertarget. While my computer could easily handle it, that was not for everybody the case. This was more or less the :~ty math I used:
-
That only happens on a local server, since clients/players normally can't change the server `realtime`. Or your code is clientside by accident.
- 1 reply
-
- 1
-
-
Maybe stopping the engine does work as well. It is not as if I have already tried it before.
-
Did you try to capture the pixels, transfer them to a new texture (and maybe enable mipmaps if needed)? (do not do this every frame) That way you wouldn't lose your rendertargets either after minimizing etc.
-
Ask your self first: "how do I refer to any of these values?" Inspect your table: iprint(items ) Until you are able to get the first and the second value. After that (tell me when you are ready) we are going to take the easy route: guiCreateGridList. Because the concept of "dx items" seems to be a too high level for now.
-
Set it to 0, every frame. https://wiki.multitheftauto.com/wiki/OnClientRender
-
Do first all the steps from above. Then structure your table and sub-tables like this: local items = { { label = "Test1", value = 1 }, { label = "Test2", value = 2 }, { label = "Test3", value = 3 } } local item = items[1] iprint("The label is:", item.label, " and the value is: ", item.value) Main table: local items = { { label = "Test1", value = 1 }, { label = "Test2", value = 2 }, { label = "Test3", value = 3 } } Sub-tables: local items = { { label = "Test1", value = 1 }, { label = "Test2", value = 2 }, { label = "Test3", value = 3 } }
-
Are the images drawn from path? (not recommended: line 68) If not, what are the arguments you use for the textures?
-
You need this part of you previous code: local items = {{"Test"},{"Test1"},{"Test2"},} for i = currentCell + 1, maxRows + currentCell do local value = items[i] local key = i - currentCell - 1 if value ~= nil then -- check cursor here end end You need the position of the rectangle: dxDrawRectangle ( float startX, float startY, float width, float height ) screenW * 0.7499, screenH * 0.3269+((key)*27), screenW * 0.2380, screenH * 0.025 Combine that with this useful function (don't forget to copy the function from that wiki page): https://wiki.multitheftauto.com/wiki/IsMouseInPosition isMouseInPosition ( int x, int y, int width, int height ) And you need a break to stop the loop: --for i=1, 100 do --if something then --outputChatBox("found") break --end --end Can you build it with all the bricks from above?
-
How to send these server side values to a client side list?
IIYAMA replied to thund3rbird23's topic in Scripting
Before I forget. If you want to SET it per player. setElementData(player, "weaponmodel", --[[...]]) GET for yourself. getElementData(localPlayer, "weaponmodel") -
How to send these server side values to a client side list?
IIYAMA replied to thund3rbird23's topic in Scripting
Nope, this is what it should become: {123, 321, 231, 312, 132} Unless you want to add more data PER weapon model. Btw if you want to send + get data to each individual: -
How to send these server side values to a client side list?
IIYAMA replied to thund3rbird23's topic in Scripting
By putting it in a new table. local newTable = {} for k,v in ipairs(weapons) do newTable[#newTable + 1] = v["model"] end and SET that. -
How to send these server side values to a client side list?
IIYAMA replied to thund3rbird23's topic in Scripting
Don't save it per player. Because everybody will download the data double/triple/10x/100x/1000x... ? Save all data inside of the element resourceRoot, under the key "weaponmodel" local weapons = dbPoll(query,-1) if weapons then setElementData(resourceRoot, "weaponmodel", weapons) end Now debug the data, when it is available. local weapons function draw() weapons = weapons or getElementData(resourceRoot, "weaponmodel") -- if no data from buffer, get the data. if weapons then dxDrawText(inspect(weapons), 300, 300) end end addEventHandler("onClientRender", root, draw) -
How to send these server side values to a client side list?
IIYAMA replied to thund3rbird23's topic in Scripting
You are SET the elementData to each player element and you try to GET the elementdata from the root element. (Not the same element) Recommendation: - SET and GET it with the resourceRoot. - GET the data each frame, because you do not know when it is available. -
There are fade in/out states for the camera, maybe a script sets an invalid value, does not set the right one or none at all. https://wiki.multitheftauto.com/wiki/FadeCamera
-
By cancelling these event: https://wiki.multitheftauto.com/wiki/OnClientPlayerHeliKilled (Players) https://wiki.multitheftauto.com/wiki/OnClientPedHeliKilled (Peds) See examples on those pages.
-
You can attach an object to the weapon (same model) and set the opacity of the weapon-element to 0. This way you can change the attach offset in depended.
-
You can only use WHERE once. After that you have the operators: AND, OR and NOT at your disposal. See these examples: https://www.w3schools.com/sql/sql_and_or.asp
- 1 reply
-
- 1
-
-
Be careful with this, doing this every frame will kill the network of other players that are not inside of the local-network. The following function can be used to reduce update. (every 300 milliseconds) if checkPassiveTimer("attachedToWeapon_aim", true, 300) then setElementData ( localPlayer, "attachedToWeapon_aim", {hitX,hitY,hitZ} ) end It is a useful function (by me), source code can be found here: https://wiki.multitheftauto.com/wiki/CheckPassiveTimer
-
I have experimented with the first part. The rest is for you to do. setElementAlpha(localPlayer, 0) addEventHandler("onClientResourceStop", resourceRoot, function () setElementAlpha(localPlayer, 255) end) addEventHandler("onClientPreRender", root, function () --[[ Creating the direction vector ]] local cameraX, cameraY, cameraZ, lx, ly, lz = getCameraMatrix() local directionVector = (Vector3(lx, ly, lz) - Vector3( cameraX, cameraY, cameraZ)) directionVector:normalize ( ) directionVector = directionVector * 300 local screenX, screenY = guiGetScreenSize() local startPositionX, startPositionY, startPositionZ = x, y, z local turrentX, turretY, turretZ = getElementPosition(localPlayer) -- must be the turret position turretZ = turretZ - 0.2 -- < just for test purposes -- draw turret dxDrawLine3D(turrentX, turretY, turretZ, turrentX, turretY, turretZ - 0.5, tocolor(0,0,0)) dxDrawLine3D(turrentX, turretY, turretZ - 0.5, turrentX + 0.5, turretY, turretZ - 1, tocolor(0,0,0)) dxDrawLine3D(turrentX, turretY, turretZ - 0.5, turrentX - 0.5, turretY, turretZ - 1, tocolor(0,0,0)) dxDrawLine3D(turrentX, turretY, turretZ - 0.5, turrentX, turretY - 0.5, turretZ - 1, tocolor(0,0,0)) dxDrawLine3D(turrentX, turretY, turretZ - 0.5, turrentX, turretY + 0.5, turretZ - 1, tocolor(0,0,0)) -- detect any hits local hit, hitX, hitY, hitZ, elementHit = processLineOfSight ( turrentX, turretY, turretZ, cameraX + directionVector.x, cameraY + directionVector.y, cameraZ + directionVector.z, true, -- checkBuildings true, -- checkVehicles true, -- checkPlayers true, -- checkObjects false, -- checkDummies false, -- seeThroughStuff false, -- ignoreSomeObjectsForCamera false, -- shootThroughStuff localPlayer -- element ignoredElement ) if not hit then hitX, hitY, hitZ = cameraX + directionVector.x, cameraY + directionVector.y, cameraZ + directionVector.z end dxDrawText(hit and "COLLISION!" or "NO COLLISION!", 300, 300) -- draw the line + cursor dxDrawLine3D(turrentX, turretY, turretZ, hitX, hitY, hitZ) local cursorX, cursorY = getScreenFromWorldPosition (hitX, hitY, hitZ) if cursorX then dxDrawCircle ( cursorX, cursorY, 10) dxDrawCircle (screenX / 2, screenY / 2, 10) end end)
-
That is the first step. Depending on the dimension size. Like milliseconds/seconds/minutes/hours/days, you can also save a lot of data at these 2 dimensions: milliseconds/seconds Are those dimensions included? If yes, then I can explain a little bit more. Server triggerClientEvent(receivers, "<eventName>", resourceRoot, date) Client -- <triggerClientEvent resource> addEvent("<eventName>", true) -- <resource 1> addEventHandler("<eventName>", root, function () end) -- <resource 2> addEventHandler("<eventName>", root, function () end) ---------------------- -- or more specified. ---------------------- -- <resource 1> addEventHandler("<eventName>", getResourceRootElement ( getResourceFromName ("<triggerClientEvent resource name>")), function () end, false) -- <resource 2> addEventHandler("<eventName>", getResourceRootElement ( getResourceFromName ("<triggerClientEvent resource name>")), function () end, false)
