Jump to content
  • Global

    Global

    Chatroom Rules

    • NO SE DA SOPORTE EN CHATBOX
    • NO SPAM
    • NO FLOOD

Recommended Posts

  • Usuario
Posted (edited)

Código Client-Side:

Spoiler

 

local renderTarget = dxCreateRenderTarget( 1000, 1000, true )

local posX, posY, posZ = 14, 0, 2.8

local scroll = 0

 

local players = { }

 

for i = 1, math.random( 15, 36 ) do

 

table.insert( players, { "Row #" .. #players, math.random( 50, 180 ) } )

 

end

 

addEventHandler( "onClientRender", root,

function( )

dxSetRenderTarget( renderTarget, true )

 

local offsetY = 100

 

for i = 1, #players do

 

local posX, posY, width, height = 0, offsetY - scroll, 970, 80

 

dxDrawRectangle( posX, posY, width, height, tocolor( 0, 0, 0, 200 ) )

dxDrawText( players[ i ][ 1 ], posX + 30, posY, posX + 30 + width, posY + height, tocolor( 255, 255, 255, 255 ), 3, "default-bold", "left", "center" )

dxDrawText( players[ i ][ 2 ], posX + ( width - 30 ), posY, posX + ( width - 30 ), posY + height, tocolor( 255, 255, 255, 255 ), 3, "default-bold", "right", "center" )

offsetY = offsetY + 80

 

end

 

local contentH = #players * 80

local viewableRatio = 900 / contentH

local scrollH = 900 * viewableRatio

 

dxDrawRectangle( 970, 100, 30, 900, tocolor( 0, 0, 0, 230 ) )

dxDrawRectangle( 970, 100 + ( scroll * viewableRatio ), 30, scrollH, tocolor( 255, 255, 255, 230 ) )

dxDrawRectangle( 0, 0, 1000, 100, tocolor( 0, 0, 0, 255 ) )

dxDrawText( "Nombre de tu servidor" .. #players .. "/Cantidad de jugadores, ejemplo 100.", 0, 0, 1000, 100, tocolor( 255, 255, 255, 255 ), 5, "default-bold", "center", "center" )

 

if ( getKeyState( "pgdn" ) ) then

 

scroll = math.min( scroll + 15, contentH - 900 )

 

elseif ( getKeyState( "pgup" ) ) then

 

scroll = math.max( scroll - 15, 0 )

 

end

 

dxSetRenderTarget( )

dxDrawMaterialLine3D( posX, posY, posZ + 5, posX, posY, posZ, renderTarget, 5, tocolor( 255, 255, 255, 255 ), true )

end

)

 

Edited by MedicenMarcos

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...