Tokio Posted May 5, 2018 Share Posted May 5, 2018 (edited) 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 May 5, 2018 by 50cent Link to comment
LilDawage Posted May 5, 2018 Share Posted May 5, 2018 explain more scoreboard Tab , or scoreboard for count kills or death or something like that Link to comment
Tokio Posted May 5, 2018 Author Share Posted May 5, 2018 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 Link to comment
Dimos7 Posted May 5, 2018 Share Posted May 5, 2018 (edited) dxDrawRectangle dxDrawLine dxDrawText Edited May 5, 2018 by Dimos7 Link to comment
Tokio Posted May 5, 2018 Author Share Posted May 5, 2018 2 minutes ago, Dimos7 said: dxDrawRectangle dxDrawLine dxDrawText These i know... But how to add players, and make scrollable? Link to comment
Dimos7 Posted May 5, 2018 Share Posted May 5, 2018 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 Link to comment
Tokio Posted May 5, 2018 Author Share Posted May 5, 2018 now the player loop works perfectly, but how to make the scrolling? Link to comment
NeXuS™ Posted May 5, 2018 Share Posted May 5, 2018 (edited) 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 May 5, 2018 by NeXuS™ Link to comment
Tokio Posted May 5, 2018 Author Share Posted May 5, 2018 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 can you show a example? Link to comment
NeXuS™ Posted May 5, 2018 Share Posted May 5, 2018 (edited) 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 May 5, 2018 by NeXuS™ Link to comment
Tokio Posted May 6, 2018 Author Share Posted May 6, 2018 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? Link to comment
NeXuS™ Posted May 6, 2018 Share Posted May 6, 2018 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 1 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