Tokio

[Help] How to make a scoreboard?

Recommended Posts

I want create a custom scoreboard.. But, how to add players to it with rectangle, and dxdrawtext(s), and when there are xy players, how to make scrollable?? 

Sorry for my bad english.. :c

Edited by 50cent

Share this post


Link to post

explain more scoreboard Tab , or scoreboard for count kills or death or something like that

Share this post


Link to post
2 minutes ago, LilDawage said:

explain more scoreboard Tab , or scoreboard for count kills or death or something like that

? I want make a custom scoreboard not column

Share this post


Link to post
dxDrawRectangle
dxDrawLine
dxDrawText

 

Edited by Dimos7

Share this post


Link to post
2 minutes ago, Dimos7 said:

dxDrawRectangle
dxDrawLine
dxDrawText

 

These i know... But how to add players, and make scrollable?

Share this post


Link to post

make a loop for all player and when a player joins add him to scoreboard make it a line and bind it so when its active and pres down go down etc

Share this post


Link to post

now the player loop works perfectly, but how to make the scrolling?

Share this post


Link to post

The easiest way without modifying a ton of things is just making the table as a variable and in the loop, looping through from n to n + scoreboard rows, then selecting the players with playerTable[ i ]. You can just increase or decrease "n" and that should make the scrolling working.

Edited by NeXuS™

Share this post


Link to post
30 minutes ago, NeXuS™ said:

The easiest way without modifying a ton of things is just making the table as a variable and in the loop, looping through from n to n + scoreboard rows, then selecting the players with playerTable[ i ]. You can just increase or decrease "n" and that should make the scrolling working.

I dont understand this :S can you show a example?

Share this post


Link to post
local scrollN = 0

local pTable = getElementsByType("player")

for i = scrollN, scrollN + 12 do
	local selectedP = pTable[i]
	...
end

You'll have to arrange the code, and add a way to increase and decrease the scrollN value.

Edited by NeXuS™

Share this post


Link to post
7 hours ago, NeXuS™ said:

local scrollN = 0

local pTable = getElementsByType("player")

for i = scrollN, scrollN + 12 do
	local selectedP = pTable[i]
	...
end

You'll have to arrange the code, and add a way to increase and decrease the scrollN value.

where to put in the code? after  "  for id, player in ipairs(all_players) do " or before?
 

Share this post


Link to post

I wont tell you exactly how to make your script. I'll explain that little snippet of the code.

local scrollN = 0 -- Settings scrolling state to 0, so the scrolling is at the top.

local pTable = getElementsByType("player") -- Getting the players.

for i = scrollN, scrollN + 12 do -- Using the scrollN value, we can scroll through the players in the pTable, increasing the scrollN value will make to skip the first N players in the table.
	local selectedP = pTable[i] -- Selecting the player from the playerTable using the "i" val.
	... -- Drawing player info.
end

 

  • Like 1

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.