Jump to content

Animan99

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by Animan99

  1. addEventHandler('onClientResourceStart', resourceRoot, function() shader = dxCreateShader('shader.fx') terrain = dxCreateTexture('img/PJ_Elegy2.png') dxSetShaderValue(shader, 'gTexture', terrain) engineApplyShaderToWorldTexture(shader, 'remapelegybody128') end ) I didnt post the full code becouse i have googled much and figured out that the problem is in the engineApply function, 2nd agrument. When i tried without car mods, it worked perfectly!
  2. Hi i made my first tuneshop, working fine, now i want to apply a custom paintjob to a modded car, but it's not working. engineApplyShaderToWorldTexture( shader, "remapelegybody128") I tried this way, but not working, also tried almost everything. Can anyone help me? (I don't know what should i write on the second argument)
  3. Animan99

    Table data

    thanks, i figured out that my problem is not this, so i do not know anything anymore. i have this function to move items: function itemMoveToSlot(item, newSlot) for k, v in ipairs(Items) do if isSlotEmpty(ujSlot) then Items[k][2] = newSlot end end end this is working, when i have ONE item in the items table(this table contains all the items that the player currently have) if i have 2 or more items then the first item is not moving, just the second one, and the first one moves with the second.
  4. Animan99

    Table data

    hello. I am working on an invetory system, but i have a problem, i couldn't solve. if i hover a picture, or rectangle then get that value from table. Here is a way to do this(this will explain if you dont understand so read the comments) asd = { {"asd1", 1}, {"asd2", 2}, {"asd3", 3}, } addEventHandler("onClientRender", getRootElement(), function() local row = 0 local elem = 0 cx, cy = getCursorPosition() cx, cy = cx*sW, cy*sH for k, v in ipairs(asd) do dxDrawRectangle(X, Y + row, W, H, tocolor(0, 0, 0, 150)) -- + row - this will render 3 rectangle because 3 value is in table named "asd" if cx > X and cx < X + W and cy > Y + row and cy < Y + H + row then -- if cursor on any rendered rectangle hoveredText = v[1] -- this RETURNS ONE VALUE not the all values in table dxDrawText(hoveredText, X, Y + row, 0, 0, etc..) -- if my cursor on the first rectangle this will draw the first value from table (asd1) and this is what i need but i have to find another way to solve this. end row = row + 25 elem = elem + 1 end end) So what i want that the table return one value that i hover or click. I have to do with ANOTHER method, because i cannot do my inventory with this. So this is wrong: for k, v in ipairs(items) do if getKeyState("mouse1") and isInBox(cx, cy, X , Y, X2, Y2) then hoverText = v[1] -- this returns ALL values in table end end so i need a way to get table a data like above, not all data. I need this because when i am moving an item from my inventory sadly all item moves. i want that specific item to move, (items in table) so this is what i need this. Hope you understand, sorry for bad english.
  5. local data = { login = { hover = false, alphaMode = false, alapAlpha = 190, colors = { 255, 255, 255 } } } function renderDx() --------- This is the hover if data.login.hover then data.login.colors = {201, 0, 20} if not data.login.alphaMode then data.login.alapAlpha = data.login.alapAlpha - 5 if data.login.alapAlpha <= 40 then data.login.alphaMode = true end else data.login.alapAlpha = data.login.alapAlpha + 5 if data.login.alapAlpha >= 190 then data.login.alphaMode = false end end end end addEventHandler("onClientRender", getRootElement(), renderDx) addEventHandler("onClientCursorMove", getRootElement(), function(_, _, x, y) if x > X + 35 and x < X + 195 then --- write your pos if y > Y + 187 and y < Y + 214 then data.login.hover = true else data.login.hover = false data.login.alapAlpha = 190 data.login.colors = { 255, 255, 255 } data.login.alphaMode = false end end) } And finally you have to display the dx like this: dxDrawText("STH", X , Y, 0, 0, tocolor(data.login.colors[1], data.login.colors[2], data.login.colors[3], data.login.alapAlpha), 1, "arial", _, _, _, _, _, true) copied from my script
  6. Sry, forgot sW, sH = guiGetScreenSize() Width, Height = 324, 246 X = sW - Width Y = sH - Height function renderSpeedo() local speed = getVehicleSpeed(getPedOccupiedVehicle(localPlayer)) dxDrawImage(X, Y, Width, Height, "fajlok/alap.png", 0, 0, 0) dxDrawImage(X, Y, Width, Height, "fajlok/mutato1.png", speed*4.2 / getFormatGear() ) -- RPM needle dxDrawImage(X, Y, Width, Height, "fajlok/mutato2.png", speed/1.3 ) -- SPEED NEEDLE dxDrawText(speed, X + 150, Y + 150, 0, 0, tocolor(255, 255, 255, 150), 1.5, "arial" ) end
  7. Hi, i have started to make my own speedometer. When i speed up, the needle does not move correctly. at the start when i am not going fast, it fits right, but when my speed is higher, i goes out of my speedo "disc". Pictures: (low speed fits correctly) http://kepfeltoltes.hu/150728/mta-scree ... es.hu_.png (high speed does not) http://kepfeltoltes.hu/150728/mta-scree ... es.hu_.png anyone can help me? Thanks
  8. did that already, doesnt work. however tried with in another resource just with a label, worked... dunno why
  9. can Anybody help me, how to solve this? i know there are lots of clever people here. Please, help
  10. player B does not see the message, hovever i send it to server and back to client ( Anybody?
  11. almost. 2 mistakes. local Width, Height = 500, 150 -- dont write here your resolution. Write here the width and height of the image you want to draw with dxDrawImage function HUD() local weaponType = getPedWeapon(localPlayer) dxDrawImage(X, Y, Width, Height, "Weapons/"..tostring(weaponType).. ".png", 0, 0, 0, tocolor(255, 255, 255, 255), false) --you have to use the X, Y, Width, Height variables here to work end
  12. local sWidth, sHeight = guiGetScreenSize() local Width, Height = A, B --write the width and height here local X = sWidth - Width local Y = 0 dxDrawImage(X, Y, Width, Height, etc...)
  13. https://wiki.multitheftauto.com/wiki/DxDrawImage
  14. hide the original HUD with (https://wiki.multitheftauto.com/wiki/Se ... entVisible) and make your own with dxDraw
  15. Animan99

    Help

    setTimer ( function() Spawn() end, 5*1000, 1)
  16. Animan99

    help fast

    local locations = { {x, y, z}, {x, y, z}, {x, y, z} } random = math.random(1, #locations) spawnpoint = locations[random] spawnPlayer(source, spawnpoint[1], spawnpoint[2], spawnpoint[3])
  17. create vehicle server side and use triggerServerEvent
  18. try with setElementHealth
  19. i said it right then... local table = {} addEventHandler("onClientGUIClick", button1, function() if #table <= 5 then table.insert(table, 5) end end) wirte the value... dxDrawText(table.concat(table)) -- write it like this: table.concat(tablename) you can do this with edit box, just set the text of the edit box like this guiSetText(edit, table.concat(table))
  20. Then how to send the message to player B? you said with triggerServer - Client events.
  21. can you help me with this triggerServer - Client event? i tried it, but cannot recognize guiGetText(editbox) local renderData = {} addEvent("UzenetKuldes", true) addEventHandler("UzenetKuldes", root, function() for k, v in ipairs(getElementsByType("player")) do if getElementData(localPlayer, "phone") == "goingCall" then renderData.asdlabel = guiCreateLabel(renderData.smsDrawX, renderData.smsDrawY, 200, 500, guiGetText(callInput), false, renderData.labelParent) outputChatBox("triggerelve") end end end) attempt to call global guiGetText etc.. .a nil value
  22. Thank you i did this element data way for the other parts of the script you cannot see. I have about 20 element data right now for player A and player B I try your method tomorrow. I know the triggering stuff, used many times but i thought that i can make it without it Thanks. I will post a comment here, if its working or not
×
×
  • Create New...