Jump to content

Tekken

Helpers
  • Posts

    1,423
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Tekken

  1. Try like this addEventHandler("onClientPlayerDamage", localPlayer, function(attacker, weapon, bodypart) local veh = getPedOccupiedVehicle(source); --Check if player is in vehicle if veh and getElementModel(veh) == 409 then cancelEvent(); -- cancel if the player is in vehicle 409 end end);
  2. Well you will have to cancel also the damage for player while in the vehicle
  3. @xPeacefullDreams Well I actually didn't know those where relative to the player... thank you so much !
  4. Hi I’m trying to create an object just in front of me and attach it to me so it will move as I move, problem is I’m no mathematician , an if I’m not mistaking it requires some math.sin math.cos workaround. Greetings.
  5. if i <= 2 than not sure is that you need but you may try
  6. Well that’s because you start counting from the lowest to the highest if you start from the highest that’s should only output once
  7. I am pretty sure there’s a setting in meta.xml for allowing color codes
  8. Just add a outputChatBox after each if statement
  9. You’re welcome. You can also do tablePlayers[player]["skin"] = skinid for a better way of storing data than get/setElementData
  10. Well you should use a tabel to store player element like this playersTable = {} and after to store it you do this playersTable[thePlayer] = v[1] you got it?
  11. local data = dbPoll("your data to be returned using normal MySQL"); for i,v in ipairs(data) do v["var_name_in_db"] end Please note that this is a simple example for better understanding please read dbPoll wiki page.
  12. 1 - Da merita. 2 - In principiu nu, in practica nu stiu succes!
  13. Din pacate nu prea cred ca putem face ceva doar in deschizand servere, si nu cred ca v-om putea face ceva prea curand avand in vedere ca daca scrii Romania in tabul de cautare pe MTA ai 30 de servere dintre care 25 de RP/RPG pustii, cea ce nu inteleg eu este de ce sunt aceste servere deschise de luni de zile fara jucatori dar care insista sa ramana deschise, de ce? Opinia mea e ca echopa MTA ar trebui sa stearga pur si simplu serverele nepopulate implementand un fel de algoritm, dar nu prea cred ca o sa vedem asa ceva prea curand.
  14. Tekken

    gui scroll

    Merci tuturor pentru participare am reusit cu scrollpane :)
  15. Tekken

    gui scroll

    Un mic exemplu umpic simplificat. local sX, sY = guiGetScreenSize(); local bgW, bgH = 260, 470; local bgX, bgY = (sX-bgW)/2, (sY-bgH)/2; local lW = (bgW-15)/2; local sW = (bgW-25)/4; local row = 0; function drawInventory() if isInvOpen then inventar = guiCreateStaticImage(bgX+(bgW/2), bgY-15, bgW, bgH, "images/bg.png", false); -- Fundalul local loot = isPlayerInLoot(); if loot then guix, guiy = bgX+(bgW/1.25), bgY-15; else guix, guiy = bgX, bgY-15; end guiSetPosition(inventar, guix, guiy, false); --Pozitia fundalului local offsetX, offsetY = 5, 5; width = 0; row = 1; for i = 1, 7 do if i < 3 then width = lW; else width = sW; end for _,v in ipairs(inventoryItems[i]) do local q = getElementData(localPlayer, v[1]) or 0; if (q > 0) then if bgW-offsetX < width then offsetX = 5; offsetY = offsetY+(sW+5); row = row + 1; end local bgImage = guiCreateStaticImage(offsetX, offsetY, width, sW, "images/scoreboard.png", false, inventar); --Imaginea fundalului itemului guiSetAlpha(bgImage, 0.1); local theItem = guiCreateStaticImage(offsetX, offsetY, width, sW, "images/items/"..v[1]..".png", false, inventar); --Imaginea itemului local theLabel = guiCreateLabel(0, 0, 1, 1, "1", true, theItem); guiSetFont(theLabel, "default-bold-small"); alphaTable[theLabel] = bgImage; imgDataTable[theLabel] = {npath, width, 1, v[1]}; offsetX = offsetX + width + 5; end end end end end -- tentativa de scroll bindKey("mouse_wheel_up", "down", function() if isInvOpen then if getMousePosition() == "inventar" then if row <= 7 then return; end if rowsMoved == 0 then return; end local toadd = sW+5; rowsMoved = rowsMoved - 1; for _,v in ipairs(getElementsByType("gui-staticimage")) do if getElementParent(v) == inventar then local x, y = guiGetPosition(v, false); guiSetPosition(v, x, y+toadd, false); end end end end end); bindKey("mouse_wheel_down", "down", function() if isInvOpen then if getMousePosition() == "inventar" then if rowsMoved + 7 >= row then return; end if rowsMoved == row then return; end local toadd = sW+5; rowsMoved = rowsMoved + 1; for _,v in ipairs(getElementsByType("gui-staticimage")) do if getElementParent(v) == inventar then local x, y = guiGetPosition(v, false); guiSetPosition(v, x, y-toadd, false); end end end end end); Arata asa: https://imgur.com/a/FegFWat Dar dupa cateva scrolluri arata asa: https://imgur.com/WqbtGxv N-am incercat inca scrollpane.
  16. Tekken

    gui scroll

    Oups nu m-am exprimat bine, folosesc o imagine ca fundal deci fara scrollpanel, nu sunt sigur dar parca scrollpanel nu este transparent nu? Ideea e ca nu vreau sa se vada gen sa fie ca in dx.
  17. Tekken

    gui scroll

    Salut, de curand m-am apucat sa refac un inventory pentru DayZ « dinala jmeker » cu imagini, si cum eu sut umpic cam nul in dx l-am facut in gui, toate bune si frumoase totul merge ca planuit mai putin scrollul, eu am incercat ceva de genu’ cu bindkey mouse_well_up si down si o iterare in getElementsByType("gui-staticimage ") si gen sa le adaug sau sa le scat din height, merge, dar de fiecare data cand dau scroll in sus sau in jos pierd sau eventual castig in dimensiuni cea ce imi face imaginile sa se suprapuna cand revin la pozitia initiala , si nu inteleg de ce, poate cineva mai experimentat in dx sau gui ma poate ajuta, o sa pun un exemplu mai tarziu ca acum is pe telefon. O intrebate serioasa pe ro sa vedem daca gasim si solutie. Sunt dispus sa raspund la intrebari de genul, daca bineinteles se si formuleaza sa avem umpic de activitate pe forum, zic.
  18. 2 - For triggering once a week I highly recommend getRealTime() 1 - Why in server side?
×
×
  • Create New...