Jump to content

Tekken

Helpers
  • Posts

    1,423
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Tekken

  1. dxDrawCircle returns a filled circle, the idea behind this is to create those circles as health indicators. Haven’t tried making alpha 0 to center color tho
  2. You may send me all code in pm to look up if not want to share it here.
  3. You should check addEventHandler("onMarkerHit", marker_auto_teleport_botscars, function(hitElement ) if hitElement == pedveh1 and getElementParent(hitElement) == group then -- do it end end); NOTE that "onMarkerHit" event have an argument in function called thehitelement == the element that hit the marker.
  4. Have you considered taking all weapons just after saving them before you five them to player: Die > save > take(takeAllWeapons) > load > give ?
  5. I don't quite understand your code but try this: addEventHandler("onMarkerHit", marker_auto_teleport_botscars, function(hitelm) if getElementParent(hitelm) == group then if getElementType ( hitelm ) == "vehicle" and getElementModel ( hitelm ) == 405 then --print("vehicle touched 1") setElementPosition(hitelm,-414.1000061035, 157.19999694824, 41.400001525879) elseif getElementType ( hitelm ) == "vehicle" and getElementModel ( hitelm ) == 547 then --print("vehicle touched 2") setElementPosition(hitelm,-414.1000061035, 157.19999694824, 41.400001525879) elseif getElementType ( hitelm ) == "vehicle" and getElementModel ( hitelm ) == 507 then --print("vehicle touched 3") setElementPosition(hitelm,-414.1000061035, 157.19999694824, 41.400001525879) elseif getElementType ( hitelm ) == "vehicle" and getElementModel ( hitelm ) == 585 then --print("vehicle touched 4") setElementPosition(hitelm, -414.1000061035, 157.19999694824, 41.400001525879) end end end)
  6. Hi I'd like to draw an empty circle like this one: I'm currently using the example from https://wiki.multitheftauto.com/wiki/DxDrawLine but it's not a perfect circle and yet very demanding. I was wondering if there's a better way of doing this Thanks
  7. function createText1 ( ) if getElementData(localPlayer, "logedin") then if (getElementData (localPlayer, "hideTable") or {}).icons then return true end if getElementData(getLocalPlayer(), "brokenbone", true) then dxDrawImage(screenWidth * 0.94, screenHeight * 0.73, screenHeight * 0.065, screenHeight * 0.065, "brokenbone.png", 0, 0, 0, tocolor(255, 255, 255)) end ------------------------------- BLOOD ------------------------------- if getElementData(getLocalPlayer(), "blood") >= 10000 and getElementData(getLocalPlayer(), "blood") <= 12000 then elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/5.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "blood") >= 8000 and getElementData(getLocalPlayer(), "blood") <= 10000 then elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/4.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "blood") >= 6000 and getElementData(getLocalPlayer(), "blood") <= 8000 then elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/3.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "blood") >= 4000 and getElementData(getLocalPlayer(), "blood") <= 6000 then elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/2.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "blood") >= 2000 and getElementData(getLocalPlayer(), "blood") <= 4000 then elementblood2 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/1.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "blood") >= 100 and getElementData(getLocalPlayer(), "blood") <= 2000 then elementblood2 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/0.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "bleeding") > 0 then dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/bleeding.png", 0, 0, 0, tocolor(210, 10, 16)) end if getElementData(getLocalPlayer(), "infection") then dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "infection.png", 0, 0, 0, tocolor(255, 0, 0,fading)) end ------------------------------- BLOOD ------------------------------- ------------------------------- food ------------------------------- if getElementData(getLocalPlayer(), "food") >= 80 and getElementData(getLocalPlayer(), "food") <= 100 then elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/5.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "food") >= 60 and getElementData(getLocalPlayer(), "food") <= 80 then elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/4.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "food") >= 40 and getElementData(getLocalPlayer(), "food") <= 60 then elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/3.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "food") >= 20 and getElementData(getLocalPlayer(), "food") <= 40 then elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/2.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "food") >= 10 and getElementData(getLocalPlayer(), "food") <= 20 then elementblood2 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/1.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "food") >= 0 and getElementData(getLocalPlayer(), "food") <= 10 then elementblood2 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/0.png", 0, 0, 0, tocolor(162, 161, 161)) end ------------------------------- food ------------------------------- ------------------------------- drink ------------------------------- if getElementData(getLocalPlayer(), "thirst") >= 80 and getElementData(getLocalPlayer(), "thirst") <= 100 then elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/5.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "thirst") >= 60 and getElementData(getLocalPlayer(), "thirst") <= 80 then elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/4.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "thirst") >= 40 and getElementData(getLocalPlayer(), "thirst") <= 60 then elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060,"drink/3.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "thirst") >= 20 and getElementData(getLocalPlayer(), "thirst") <= 40 then elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/2.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "thirst") >= 10 and getElementData(getLocalPlayer(), "thirst") <= 20 then elementblood2 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/1.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "thirst") >= 0 and getElementData(getLocalPlayer(), "thirst") <= 10 then elementblood2 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/0.png", 0, 0, 0, tocolor(162, 161, 161)) end ------------------------------- TEMPERATURA ------------------------------- dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t2.png", 0, 0, 0, tocolor(162, 161, 161)) if getElementData(getLocalPlayer(), "temperature") <=35 then elementtemp2 = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t5.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "temperature") >= 35 and getElementData(getLocalPlayer(), "temperature") <=36 then elementtemp2 = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t4.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "temperature") >= 36 and getElementData(getLocalPlayer(), "temperature") <=37 then elementtemp4 = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t3.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "temperature") >= 37 and getElementData(getLocalPlayer(), "temperature") <=38 then elementtemp = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t3.png", 0, 0, 0, tocolor(162, 161, 161)) end if getElementData(getLocalPlayer(), "temperature") >= 38 then elementtemp = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t3.png", 0, 0, 0, tocolor(162, 161, 161)) end -------------------------------FPS------------------------------- if getElementData(getLocalPlayer(), "FPS") >= 35 and getElementData(getLocalPlayer(), "FPS") <=45 then dxDrawImage(screenWidth*0.94, screenHeight * 0.635, screenHeight * 0.065, screenHeight * 0.065, "net2.png", 0, 0, 0, tocolor(255, 255, 0,fading)) end if getElementData(getLocalPlayer(), "FPS") >= 50 and getElementData(getLocalPlayer(), "FPS") <=60 then dxDrawImage(screenWidth*0.94, screenHeight * 0.635, screenHeight * 0.065, screenHeight * 0.065, "net3.png", 0, 0, 0, tocolor(92, 141, 71,fading)) end if getElementData ( localPlayer, "clothHead" ) and getElementData ( localPlayer, "clothHead" ) ~= 0 then dxDrawImage(screenWidth * 0.90, screenHeight * 0.81, screenHeight * 0.065, screenHeight * 0.065, "bpvest1.png", 0, 0, 0, tocolor(162, 161, 161,fading) ) end if getElementData ( localPlayer, "clothBody" ) and getElementData ( localPlayer, "clothBody" ) ~= 0 then dxDrawImage(screenWidth * 0.94, screenHeight * 0.81, screenHeight * 0.065, screenHeight * 0.065, "bpvest.png", 0, 0, 0, tocolor(162, 161, 161,fading) ) end end end
  8. Tekken

    Text Timer

    TimerText[plr] = THE FUNCTION HERE --etc
  9. Add this at the very top of the onClientRender event if getElementData(getLocalPlayer(),"logedin") then That happens because the player it's not yet logged in thus it doesn't have the "blood" element data set to it!
  10. There should be a few more details! Please fill the topic correctly.
  11. He can have a variable client sided like: local isLoggedIn = false; if isLoggedIn then ...bla bla bla end and only manage peds for players that have this variable true and when login set the variable true, this should work, right?
  12. A little example local sx, sy = guiGetScreenSize(); local scaleX,scaleY = 1920/sx, 1080/sy; -- replace 1920 and 1080 with your resolution! function draw() -- Let's say we want to create a button on the right side 20px away from the screen at 150px from the bottom; local xpos = 20*scaleX; local ypos = 150*scaleY; local text = "PRESS ME!"; local tx, ty = dxGetTextSize(text, 0, 1, 1, Roboto, true); dxDrawText(text, sx-tx-xpos, sy-ty-ypos, sx-xpos, sy-ypos, tocolor(255,255,255,255), 1, Roboto, "center", "center", false, false, false, true); end addEventHandler("onClientRender", root, draw); Take a look at this tutorial: Hope that helped you!
  13. Tekken

    Text Timer

    You have to apply the same method I’ve showed you, with tables. All I can do It’s to encourage you to learn how tables work! Just follow the example I gave you. Good luck!
  14. Tekken

    Text Timer

    First of all I highly encourage you to carefully read this tutorial for better understanding Lua tables Second of all local allJailTimers = {}; function jailPlayer(plr, timer, time) if plr and timer and time then if isTimer(allJailTimers[plr]) then killTimer(allJailTimers[plr]); end allJailTimers[plr] = setTimer(function(plr) time = time - 60; m,s,cs = msToTimeStr(time); fullTime = m.." M "..s.." S"; textItemSetText(timer, ""..tostring(fullTime)); end, 50, 0, plr); end end -- 'allJailTimers' this is a table; In Lua a table is generally used to store data; -- You need a way of storing UNIC timers so we can make use of Lua tables like this in order to make unic tables local table = {}; -- an empty table. -- In order for this table to be unic for eatch player we add a SUB TABLE like this table[player] = {}; --When adding subtables we first need to be sure our table was created *see above; -- note that we added the player with [] square brackets, so this will make something like this; -- note2 when defining a subtable we never call it local local table = { -- the table [player] = { -- this will be a subtable }, [player_2] = { -- this will be another subtable for another player }, --etc }; I have tried, you may not understand so I highly recommend you read the tutorial above!
  15. Tekken

    Text Timer

    :~ what is this? some swer word? I see why, you should use tables to store timers like this: local allJailTimers = {}; function jailPlayer(player, time) if not isTimer(allJailTimers[player]) then allJailTimers[player] = setTimer(jailHim, time, 1, player); else outputChatBox("Already in jail"); end end This is as simple as it can be, if you need further help just ask !
  16. local sx, sy = guiGetScreenSize() function draw() dxDrawText("#FFB540Test text test text test text test text", sx/2-140-10,sy/2-320/2, 0, sy/2-515/2+36, tocolor(255,255,255,255), 1, Roboto, "left", "center",false,false,false,true); local text = "text2 text2 text2 text2 text2 text2 text2 text2"; --define text local textSize = dxGetTextWidth(text, 1, Roboto, true); -- get the width of the text; local fontHeight = dxGetFontHeight(1, Roboto); -- get the height of the text; dxDrawText(text, sx/2-textSize/2, sy/2-fontHeight/2, sx, sy, tocolor(255,255,255,255), 1, Roboto, "center", "center",false,false,false,true); --draw the text in the middle of the screen! end addEventHandler("onClientRender", root, draw); You might do the same for the first one, just keep in mind the text align works like this (X + TEXT WIDTH)
  17. As I said I have not tested it, may I know what rotx roty and rotz you enter and what you gen when converting the matrix using this function?
  18. I always recommend using default MTA variables like root instead of getRootElement() as it’s faster
  19. He’s talking about attachToBones I have a pm from him also if you visit the link it’s attachToBones
  20. Although have no experience with matrix and I'm a noob in mathematics I have found something interesting in python and convert it to Lua, not sure it will work try converting the matrix with this function: function convertRotationMatrixToEulerAngles(matrix) local roll, pitch, yaw = false, false, false; local pi = math.pi; local atan2 = math.atan2; local m_cos = math.cos; local m_sin = math.sin; if matrix then local m11, m12, m13 = matrix[1][1], matrix[1][2], matrix[1][3]; local m21, m22, m23 = matrix[2][1], matrix[2][2], matrix[2][3]; local m31, m32, m33 = matrix[3][1], matrix[3][2], matrix[3][3]; if m31 ~= 1 and m31 ~= -1 then pitch_1 = -1*m_sin(m31); pitch_2 = pi - pitch_1; roll_1 = m_atan2(m32/m_cos(pitch_1), m33/m_cos(pitch_1)); roll_2 = m_atan2(m33/m_cos(pitch_2), m33/m_cos(pitch_2)); yaw_1 = m_atan2(m21/m_cos(pitch_1), m11/m_cos(pitch_1)); yaw_2 = m_atan2(m21/m_cos(pitch_2), m11/m_cos(pitch_2)); pitch = pitch_1; roll = roll_1; yaw = yaw_1; else if m31 == -1 then pitch = pi/2; roll = yaw + m_atan2(m12, m13); else pitch = -pi/2; roll = -1*yaw + m_atan2(-1*m12,-1*m13); end yaw = 0; end roll = roll*180/pi; pitch = pitch*180/pi; yaw = yaw*180/pi; return roll, pitch, yaw; end end It will return (in theory) rotX, rotY, rotZ in degrees Hope that helps!
  21. OWL Gaming isn’t that a leaked gamemode? If so you will not receive any help!
  22. First of all what Gamemode you use? May you explain a bit better your error?
  23. Tekken

    Question

    Line 440 function SpawnZombie () replace this: if isElement(thePlayer) then with this: if isElement(thePlayer) and not (getElementData(thePlayer, "zombiesNotFollow") or false) then That may happen because the zombie died or got deleted.
  24. Tekken

    Question

    You can set an elementData to the player and within this function zombie_check () in client side you check first if localPlayer has that element data if it does you do not run the code the else run the code. Like this setElementData(localPlayer, "zombiesNotFollow", true); --You can set this both client and server side, but I suggest server side as it's much more secure. and function zombie_check () -- LINE 33 if (getElementData(localPlayer, "zombiesNotFollow") or false) then return; end if (getElementData (getLocalPlayer (), "zombie") ~= true) and ( isPedDead ( getLocalPlayer () ) == false ) then -- a lot of code here......... end end TBW there are a lot of optimizations to be done in this resource, I'm currently working on a better version will release when it's done!
×
×
  • Create New...