Jump to content

dxGridList problem


freudo

Recommended Posts

Posted

ı want list playerlist okey but list bug .D

if playerlist then 
    for id, player in ipairs(getElementsByType("player")) do 
            local playerName = getPlayerName(player) 
            local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
            table.insert(players, playerName) 
        end 
    end 

LoyNBj.png

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted

You mean that it adds a single player multiple times?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

no, one player

local players = {} 
  
    dxDrawGridList( (screenW - 251) / 2, (screenH - 254) / 2, 251, 254, 8, 70, core.language.dxGui.gridlist, players, true, false) 
    local playerlist = getElementData(core.language.dxGui.gridlist, "selected")[1] 
    if playerlist then 
    for id, player in ipairs(getElementsByType("player")) do 
            local playerName = getPlayerName(player) 
            local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
            table.insert(players, playerName) 
        end 
    end 

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted

First loop the table second

make sure that the player is not the table using if !

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

can you help me? :)

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted

Sure if i dont help you so what i do ?

for i, val in ipairs(players) do  
if val ~= playerName then 
table.insert(players, playerName) end 
end 

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted
local players = getElementsByType("player") 
    local playerName = getPlayerName(source) 
    for i, val in ipairs(players) do 
    if val ~= playerName then 
    table.insert(players, playerName) end 
    end 

nothing

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted

No added the part of the code after getPlayerName in the first code after line 9

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

please give me code

for id, player in ipairs(getElementsByType("player")) do 
    if player ~= playerName then 
            table.insert(players, playerName) 
    end 
    local playerName = getPlayerName(player) 
        local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
    end 

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted

Cant i use phone ! Listen first take the first code that you give it to us second copy my code third past it after line 9 just before table.insert in you first code

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

Also dont forget to delete line 9 after all

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

yes work but have a problem :)

lost button

5Rgz6d.png

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted

Nope :P:) post your new code

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted
for id, player in ipairs(getElementsByType("player")) do 
        local playerName = getPlayerName(player) 
        local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
        table.insert(players, playerName) 
    end 
    for i, val in ipairs(getElementsByType("player")) do 
    if val ~= playerName then 
    table.insert(players, playerName) end 
    end 

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted

Delete line 4 and modify line 6 to for i, val in ipairs(players) do

past the code that draw the grid

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted
Delete line 4 and modify line 6 to for i, val in ipairs(players) do

past the code that draw the grid

Its obvious, it will draw the last player only!

Posted

nothing

for id, player in ipairs(getElementsByType("player")) do 
        local playerName = getPlayerName(player) 
        local playerName = playerName:gsub("#%x%x%x%x%x%x", "") 
    end 
    for i, val in ipairs(players) do 
    if val ~= playerName then 
    table.insert(players, playerName) end 
    end 

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

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.
×
×
  • Create New...