Jump to content

.:HyPeX:.

Members
  • Posts

    1,255
  • Joined

  • Last visited

Everything posted by .:HyPeX:.

  1. Heres your problem: local car = getPedOccupiedVehicle ( localPlayer ) local sx, sy, sz = getElementVelocity(car) Go with this: local car = getPedOccupiedVehicle ( localPlayer ) if car then local sx, sy, sz = getElementVelocity(car) else local sx,sy,sz = getElementVelocity( localPlayer ) end
  2. .:HyPeX:.

    Hex Color

    Explain better what you want do do, so we can help you.
  3. .:HyPeX:.

    TXD error

    Are you sure the TXD is okay?
  4. .:HyPeX:.

    Hex Color

    What do you mean? you want to remove them? local variable = string.gsub(stringToRemove, "#%x%x%x%x%x%x", "")
  5. My code should work, it just needs some maths workout for the exponentials including widescreen values based on the difference width-height. BTW: You're doing something wrong by using the text position with text scaling, just use the relative values (e.g. width*0.2) for position. Then work out the maths for scale.
  6. You should just work over relative values. eg: --Original resolution made on 1360*768 local width,height = guiGetScreenSize() local Difference = 0.8 -- Reducing exponential difference throught scales ScaleWorkout = ( ( 1360 / width ) * ( 768 / height ) ) * Difference dxDrawText("text", width * 0.2, height * 0.5, width * 0.4, height * 0.6, tocolor(255,0,0,255), 2 / ScaleWorkout, "default") BTW: I'm still looking for an efficient text scaling, the exponential size going to 800x600 without the exponential reduction is a very small text, this should work perfectly, but it will be a bit too much.
  7. This: addEventHandler("onClientRender",getLocalPlayer(),sound,loadingtravel) should be this: addEventHandler("onClientRender",root,sound) addEventHandler("onClientRender",root,loadingtravel)
  8. Yeah, but sometimes something veery interesting can be seen in other's scripts and you'd improve yourself. From seeing other scripts i got a huge improvement in tables wich i wouldnt have done by myself. Its more like seeing wiki examples, if you think it detailed. I had this also, but in a jar, i deleted it some time ago thought. In my opinion, I think Jar just ruin your computer Got no doubt on that, thought it did worked.
  9. Yeah, but sometimes something veery interesting can be seen in other's scripts and you'd improve yourself. From seeing other scripts i got a huge improvement in tables wich i wouldnt have done by myself. Its more like seeing wiki examples, if you think it detailed. I had this also, but in a jar, i deleted it some time ago thought.
  10. banPlayer lets you ban by username thougt. just re-read the function.
  11. Wanted to add this over just in case: To get a 0-1 value from 0-255: value = alpha / 255
  12. Make it easier, just save a % of that to the data every that % of time (Eg: 20% every min)
  13. Yes, if he's still then he's just camping. If you want to make it more exact, just store down the value to a variable for the player and check it after the time you want, and if the distance is okay (getDistanceBetweenPoints2D) then go foward. (But i dont really recommend this)
  14. Hey Ben First of all, thanks for asking politely (i really like when people do so). Now, regarding to your problem: function CheckPosition(sx,sy,ex,ey) local cx,cy = getCursorPositon() if cx > sx and cy > sy then if cx < ex and cy < ey then return true else return nil end end Now coming to your case (after you got this down in your code) if CheckPosition(bx,by,bx + x2, by + butH) then end PD: This supposes that you work over relative values, as you should, and write it down like this: local x,y = guiGetScreenSize() dxDrawRectangle(bx * x,by * y,x2 * x,butH * y,tocolor(23,23,23,204),false) Else, just do some maths to get the relative values over screen position (0-1) Greets HyPeX EDIT: About the example, this is a part of my BF3 Gamemode Team-Selection part: CursorX, CursorY = getCursorPosition() if not CursorX then return end if CursorX > 0.12 and CursorY > 0.33 then if CursorX < 0.37 and CursorY < 0.38 then color = tocolor(150,200,0,255) else color = tocolor(100,150,0,150) end else color = tocolor(100,150,0,150) end if CursorX > 0.12 and CursorY > 0.38 then if CursorX < 0.37 and CursorY < 0.43 then color2 = tocolor(0,200,200,255) else color2 = tocolor(0,150,150,200) end else color2 = tocolor(0,150,150,200) end local now = getTickCount() local End = StartTime + 800 local elapsed = now - StartTime local duration = End - StartTime local progress = elapsed / duration local XValue, XValue2 = interpolateBetween(0,0,0, x/4, x/3,0, progress, "Linear") if now - StartTime <= 800 then dxDrawRectangle(x/8, y/3.5, XValue, y/20, tocolor(0,0,0,200)) dxDrawText(drawText..Players.." / 32", x/5.8, y/3.4, XValue2, y/10, tocolor(0, 150, 255, 200), 1.5 /( ( 1360 / x ) * ( 768 / y ) ), "default-bold", "left","top", true,true ) elseif now - StartTime >= 800 and now - StartTime <= 1300 then local StartTime2 = StartTime + 800 local End2 = End + 800 - 500 local elapsed2 = now - StartTime2 local duration2 = End2 - StartTime2 local progress2 = elapsed2 / duration2 local YValue, YValue2 = interpolateBetween(0, 0,0, y/20, y/50,0, progress2, "Linear") dxDrawRectangle(x/8, y/3.5, x/4, y/20, tocolor(0,0,0,200)) dxDrawText(drawText..Players.." / 32", x/7.8, y/3.4, x/3, y/10, tocolor(0, 150, 255, 200), 1.5 /( ( 1360 / x ) * ( 768 / y ) ), "default-bold") dxDrawRectangle(x/8, y/2.98,x/4, YValue, color)
  15. Just take a look at the part where text = getPlayerNametagText( v ) Just Replace it with whatever the method you have to distinguish them.
  16. Just use the idle MTA function. https://wiki.multitheftauto.com/wiki/GetPlayerIdleTime
  17. InterTimer = setTimer(function() if val1 == 50 then val1 = 100 val2 = 50 else val1 = 50 val2 = 100 end end, 500, 0) local x,y = guiGetScreenSize() addEventHandler ( "onClientRender", getRootElement ( ), function ( ) local PlayerX, PlayerY, PlayerZ = getElementPosition ( getLocalPlayer ( ) ) for i, v in ipairs ( getElementsByType("player") ) do if v == getLocalPlayer() then else local PedX, PedY, PedZ = getElementPosition ( v ) local dist = getDistanceBetweenPoints3D ( PlayerX, PlayerY, PlayerZ, PedX, PedY, PedZ ) local PX, PY, PZ = getElementPosition ( getLocalPlayer ( ) ) local PeX, PeY, PeZ = getElementPosition(v) local Rot = findRotation(PeX, PeY, PX, PY) if dist <= 40 then local scx, scy = getScreenFromWorldPosition ( PedX, PedY, PedZ + 1.2, -50, true ) if isLineOfSightClear ( PlayerX, PlayerY, PlayerZ, PedX, PedY, PedZ, true, false, false, false ) and scx and scy then local alpha = 200 local r = 0 local g = 150 local b = 200 local scale = 2 local scale3d = true local font = "default-bold" local text = getPlayerNametagText ( v ) if not text or text == "" then return end dxDrawText ( text, scx, scy, scx, scy, tocolor ( r, g, b, alpha ), scale, font, "center", "center",true,true,true,true) local rem, asd, asd2 = getTimerDetails(InterTimer) local p = rem / 500 if not val1 or not val2 then return end local v1,v2,v3 = interpolateBetween(val1, 0,0, val2, 0,0, p, "Linear") local MyScale = ( ( v1 / 100 ) * 1.3 ) /( ( 1360 / x ) * ( 768 / y ) ) if dist <= 10 then if not getKeyBoundToFunction(ChallengePlayer) then bindKey("H", "down", ChallengePlayer, v) end local scx2, scy2 = getScreenFromWorldPosition ( PedX, PedY, PedZ + 1, -50, true ) local alpha2 = 255 dxDrawText ( "#66ffaaPress #ffffffH #66ffaaTo Challenge", scx2, scy2, scx2, scy2, tocolor ( r, g, b, alpha2 ), MyScale * 1.5, font, "center", "center",false,false,false,true ) else if getKeyBoundToFunction(ChallengePlayer) then unbindKey("H","down",ChallengePlayer) end end else alpha = 0 end else alpha = 0 end end end end ) Just make sure to edit the part where the text is defined (And remove the "F" thingy + timer at top.)
  18. .:HyPeX:.

    Move object

    Yeah, but it will still be a pickup, and not an object.
  19. .:HyPeX:.

    Move object

    Why a pickup? just use setElementRotation
  20. In resume, there's no way to protectem efficiently and easily rather than downloading them over and over.
  21. Okay, okay Seems like your google automatic translation failed.
  22. I think there's no limit in server names so far, i've seen very long ones. About the MySQ, im not sure.
  23. Have you globally defined number? -- Global defining number = 1 --Creation speakeruArray[number] = createObject(2229, x, y, z-1) --Removing destroyElement(speakeruArray[number]) table.remove (speakeruArray, [number])
  24. Why you use the table like that? You can use the method the guy ontop of me said, but this will keep your way (named variable foo) --Creating array speakeruArray { } --creating entry in array with key foo and value.. speakeruArray.foo = createObject(2229, x, y, z-1) --trying to delete this object using does not work destroyElement(speakeruArray.foo)
×
×
  • Create New...