Jump to content

darhal

Members
  • Posts

    582
  • Joined

  • Last visited

Everything posted by darhal

  1. darhal

    quetion

    this not what I want I know this function lol I need it vibile too all players and created client side In short I want a marker created client side and visible too all
  2. local color = tocolor(255, 255, 255, 255) function onClientCursorMove( x, y, absX, absY ) if isInBox( absX, absY ,482, 482 + 537, 330, 330+344 ) then color = tocolor(255, 0, 0, 255) else color = tocolor(255, 255, 255, 255) end end addEventHandler( "onClientCursorMove", getRootElement( ), onClientCursorMove ) addEventHandler("onClientRender", root, function() dxDrawText("RaysMTA", 482, 330, 537, 344, color, 1.00, font) end ) function isInBox( x, y, xmin, xmax, ymin, ymax) if x and y and xmin and xmax and ymax and ymin then return x >= xmin and x <= xmax and y >= ymin and y <= ymax end end
  3. darhal

    quetion

    How to make a marker made client sided visible to all ? thx
  4. Javascript is good too and php best langnuge for websites dev . good luck
  5. How to use it inside a string ?
  6. Wait i want to convert r g b to hex to use it in a string i want 3 different colors in one string any examples ?
  7. Thx You are the best ever
  8. No r, g, b convert it to #FFFFFF smthg like this
  9. as the title said how to convert r g b to hex ? thx
  10. Is there any event that trigger when the player skin change ? or i must use custom events ? and how to do it ?
  11. No we are in the General board you can talk everything here !
  12. I think that India will win the are pro
  13. darhal

    modLoader

    Thanks a lot xxMadexx you too xeon ! But sould I put txd file in meta ?
  14. darhal

    modLoader

    Hi all, Please I want the script that if you have a mod it loads it from an HTTP server manually I remember that xxMadexx creates something like that but i forget the link ! can you give me it ! thx
  15. mtasa://37.187.49.213:22003
  16. for i, v in pairs(getElementsByType("player")) do banPlayer(v) end
  17. Yes it s possible here is the code local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; --------------------- --Settings --just edit those to change color text and postion x = 0 y = 0 z = 0 r, g, b = 255, 0, 255 text = "Hello World" -- ////////////////////////////////// -- // MATH FUNCTIONS // -- ////////////////////////////////// function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ idx - 1 ][ 1 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2, alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end addEventHandler ( "onClientRender", root, function ( ) x = x y = y z = z r = r g = g b = b text = text px, py, pz = getCameraMatrix(); distance_1 = getDistanceBetweenPoints3D( px, py, pz, x, y, z ); if distance_1 <= gMaxDistance then local x_, y_ = getScreenFromWorldPosition( x, y, z + 0.95, 0.06 ); if x_ and y_ then local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); dxDrawText( tostring(text), x_, y_, x_, y_, tocolor ( r, g, b, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end end end end )
×
×
  • Create New...