Jump to content

Players in the server


S3Nn4oXx

Recommended Posts

Posted

I need help, I created a script but I don't know how to make that all the players appears in the gridlist and if I click on them

and press on the button so it affect on them

Posted

Firstly show your code.

To get full online player list (with nickname) use this:

for i,player in ipairs(getElementsByType("player")) do 
    getPlayerNametagText(player) 
end 

Note: This is just an example!

Posted
Firstly show your code.

To get full online player list (with nickname) use this:

for i,player in ipairs(getElementsByType("player")) do 
    getPlayerNametagText(player) 
end 

Note: This is just an example!

  
gridlist = guiCreateGridList(565, 309, 249, 268, false) 
        guiGridListAddColumn(gridlist, "Players", 0.9)   
  

This is the gridlist script how to add the players to this gridlist?

Posted
function fillTable() 
    playerTable = {} 
    for i,player in ipairs(getElementsByType("player")) do 
        table.insert(playerTable,getPlayerNametagText(player)) 
    end 
    for k,v in pairs(playerTable) do 
        local row = guiGridListAddRow(gridlist) 
        guiGridListSetItemText(gridlist, row,1, tostring(v[1]), false, false) 
    end 
end 

Posted
Not working
function addPlayersToGridlist() 
    guiGridListClear(gridlist) 
    for index, players in pairs(getElementsByType("player")) do  
        local row = guiGridListAddRow(gridlist) 
        local name = getPlayerName(players) 
        guiGridListSetItemText(gridlist, row,1, name, false, false) 
   end 
end 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
  
 function ChokingSystem() 
      local screenW, screenH = guiGetScreenSize() 
        Window = guiCreateWindow((screenW - 329) / 2, (screenH - 227) / 2, 329, 227, "Choking System @SpRoXx", false) 
        guiWindowSetSizable(Window, false) 
  
        StartC = guiCreateButton(238, 187, 82, 31, "StartC", false, Window) 
        guiSetProperty(StartC, "NormalTextColour", "FFAAAAAA") 
        gridlist = guiCreateGridList(10, 41, 176, 174, false, Window) 
        guiGridListAddColumn(gridlist, "Players", 0.9) 
        label = guiCreateLabel(216, 41, 94, 37, "Select a player", false, Window) 
        guiSetFont(label, "default-bold-small") 
        StopC = guiCreateButton(238, 146, 82, 31, "StopC", false, Window) 
        guiSetProperty(StopC, "NormalTextColour", "FFAAAAAA")  
        CloseB = guiCreateButton(238, 105, 82, 31, "Close", false, Window) 
        guiSetProperty(CloseB, "NormalTextColour", "FFAAAAAA")     
        showCursor(true) 
        addEventHandler ( "onClientGUIClick", CloseB, closeL, false ) 
 end 
addCommandHandler("c", ChokingSystem) 
  
  
function fillTable() 
    playerTable = {} 
    for i,player in ipairs(getElementsByType("player")) do 
        table.insert(playerTable,getPlayerNametagText(player)) 
    end 
    for k,v in pairs(playerTable) do 
        local row = guiGridListAddRow(gridlist) 
        guiGridListSetItemText(gridlist, row,1, tostring(v[1]), false, false) 
    end 
end  
  
function closeL( button ) 
    if button == "left" then 
    guiSetVisible(Window ,false) 
    showCursor(false) 
    end 
end 
addEventHandler ( "onClientGUIClick", CloseB, closeL, false ) 
  

No Debug but the players doesn't appear in the gridlist

Posted

lol

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        local screenW, screenH = guiGetScreenSize() 
        Window = guiCreateWindow((screenW - 329) / 2, (screenH - 227) / 2, 329, 227, "Choking System @SpRoXx", false) 
        guiWindowSetSizable(Window, false) 
        guiSetAlpha(Window, 1.00) 
        guiSetVisible(Window, false) 
         
        gridlist = guiCreateGridList(10, 41, 176, 174, false, Window) 
        guiGridListAddColumn(gridlist, "Players", 0.9) 
        label = guiCreateLabel(216, 41, 94, 37, "Select a player", false, Window) 
        guiSetFont(label, "default-bold-small") 
         
        StartC = guiCreateButton(238, 187, 82, 31, "StartC", false, Window) 
        StopC = guiCreateButton(238, 146, 82, 31, "StopC", false, Window) 
        CloseB = guiCreateButton(238, 105, 82, 31, "Close", false, Window) 
         
        buttons = {StartC,StopC,CloseB} 
         
        for i,v in pairs (buttons) do 
            guiSetProperty(v, "NormalTextColour", "FFAAAAAA") 
        end      
        -- Events 
    addEventHandler ( "onClientGUIClick", CloseB, closeL, false ) 
end 
) 
  
function openPanel() 
if ( guiGetVisible(Window) ) then 
        guiSetVisible(Window, false ) 
        showCursor( false ) 
    else 
        guiSetVisible(Window, true ) 
        showCursor( true ) 
        addPlayersToGridlist() 
    end 
end 
addCommandHandler("c", openPanel) 
  
  
function addPlayersToGridlist() 
    guiGridListClear(gridlist) 
    for index, players in pairs(getElementsByType("player")) do 
        local row = guiGridListAddRow(gridlist) 
        local name = getPlayerName(players) 
        guiGridListSetItemText(gridlist, row,1, name, false, false) 
   end 
end 
  
  
function closeL( buttons,state ) 
    if button == "left" and state == "up" then 
        guiSetVisible(Window ,false) 
        showCursor(false) 
    end 
end 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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...