Popular Post DBY Posted April 21, 2017 Popular Post Share Posted April 21, 2017 (edited) I was bored and long time without do any script so I started looking in the wiki some functions what I not used yet and I found dxDrawMaterialLine3D. You have a video and code about a scoreboard what I made for test this function. Maybe this can be useful for you ( take scrollbar, etc ). Client-Side code: 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( "3D Scoreboard " .. #players .. "/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 ), 0, 0, 0 ) end ) Edited April 21, 2017 by danibayez 8 Link to comment
Simple0x47 Posted April 21, 2017 Share Posted April 21, 2017 I like seeing people sharing which others the knownledge adquired in an individual learning process without waiting any kind of benefits. Respect. 2 Link to comment
Syntrax# Posted April 22, 2017 Share Posted April 22, 2017 Thanks for sharing this, i'm defenitly using this as a way to see what players are currenty playing in the arena in my Pvp Minigame. Will show some pictures of this later on Link to comment
DBY Posted April 22, 2017 Author Share Posted April 22, 2017 3 hours ago, Syntrax# said: Thanks for sharing this, i'm defenitly using this as a way to see what players are currenty playing in the arena in my Pvp Minigame. Will show some pictures of this later on See my code useful for you made me happy. I'm waiting your pictures Link to comment
Syntrax# Posted April 22, 2017 Share Posted April 22, 2017 3 hours ago, danibayez said: See my code useful for you made me happy. I'm waiting your pictures i've edited the code abit to create a kind of selection menu and i've to say it did work out pretty well i'm pretty happy with the results.Ofcourse i keep the credits to you since you've made this gridlist 1 Link to comment
Syntrax# Posted April 22, 2017 Share Posted April 22, 2017 Edited version now supports rotating vehicle and number on the right has been changed 3 Link to comment
aka Blue Posted April 24, 2017 Share Posted April 24, 2017 @Syntrax# Nice. ¿You gonna post the code? Link to comment
Syntrax# Posted April 24, 2017 Share Posted April 24, 2017 1 hour ago, aka Blue said: @Syntrax# Nice. ¿You gonna post the code? No i'm currently going to use it for my RoleplayGaming server called Dynasty Network Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now