Jump to content

خشووو سرييع شئ مهم


Recommended Posts

ألسلام عليكم شباب

انا سويت قريد ليست و ابى اضيف فيها اسماء اللاعبين الى ب تيم انا احدده

ممكن تشوفو شو الخطآ الى فى الكود

local theTeam = getTeamFromName ( Blue ) 
if ( theTeam ) then 
local players = getPlayersInTeam ( players )  
for playerKey, playerValue in ipairs ( players ) do 
    local aRow = guiGridListAddRow ( Gblue ) 
        guiGridListSetItemText ( Gblue, aRow, 1, ''..i..'', true, false ) 
        guiGridListSetItemText ( Gblue, aRow, 2, getPlayerName(playerValue), true, false ) 
         
        end 
end 
   

Link to comment

# Not Tested :

for i, v in ipairs ( getElementsByType ( 'player' ) ) do 
    if ( getPlayerTeam( getTeamName ( v ) == 'TeamName' ) ) then 
    local Row = guiGridListAddRow ( GridList ) 
        guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) 
        guiGridListSetItemText ( GridList, Row, 2, v, false, false ) 
    end 
end 
Link to comment
# Not Tested :

for i, v in ipairs ( getElementsByType ( 'player' ) ) do 
    if ( getPlayerTeam( getTeamName ( v ) == 'TeamName' ) ) then 
    local Row = guiGridListAddRow ( GridList ) 
        guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) 
        guiGridListSetItemText ( GridList, Row, 2, v, false, false ) 
    end 
end 

لا يعمل

Link to comment

خليت سترنق لأسم التيم وماضبط ؟

local theTeam = getTeamFromName ( Blue ) 

إلى

local theTeam = getTeamFromName ( "Blue" ) 

أو جرب كود عقيد مع تعديلي

for k, v in ipairs ( getElementsByType ( 'player' ) ) do 
    if ( getPlayerTeam( getTeamName ( v ) == 'Blue' ) ) then 
    local Row = guiGridListAddRow ( GridList ) 
        guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) 
        guiGridListSetItemText ( GridList, Row, 2, getPlayerName(v), false, false ) 
    end 
end 
Link to comment
خليت سترنق لأسم التيم وماضبط ؟

local theTeam = getTeamFromName ( Blue ) 

إلى

local theTeam = getTeamFromName ( "Blue" ) 

أو جرب كود عقيد مع تعديلي

for k, v in ipairs ( getElementsByType ( 'player' ) ) do 
    if ( getPlayerTeam( getTeamName ( v ) == 'Blue' ) ) then 
    local Row = guiGridListAddRow ( GridList ) 
        guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) 
        guiGridListSetItemText ( GridList, Row, 2, getPlayerName(v), false, false ) 
    end 
end 

الأثنين ما ظبطو

Link to comment
for k, v in ipairs ( getElementsByType ( 'player' ) ) do 
    if getTeamName(getPlayerTeam(v)) == "teamName" then 
    local Row = guiGridListAddRow ( GridList ) 
        guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) 
        guiGridListSetItemText ( GridList, Row, 2, getPlayerName(v), false, false ) 
    end 
end 

^ تصحيح كود عقيد

طبعاً تحط مكان teamName في التحقق

اسم التيم الي تبيه

Link to comment
for k, v in ipairs ( getElementsByType ( 'player' ) ) do 
    if getTeamName(getPlayerTeam(v)) == "teamName" then 
    local Row = guiGridListAddRow ( GridList ) 
        guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) 
        guiGridListSetItemText ( GridList, Row, 2, getPlayerName(v), false, false ) 
    end 
end 

^ تصحيح كود عقيد

طبعاً تحط مكان teamName في التحقق

اسم التيم الي تبيه

لم يعمل :cry:

Link to comment
local theTeam = getTeamFromName("Blue") 
if (theTeam) then 
        local players = getPlayersInTeam(theTeam) 
        guiGridListClear(Gblue) 
        for playerKey, playerValue in ipairs(players) do 
                 local aRow = guiGridListAddRow(Gblue) 
                 guiGridListSetItemText(Gblue, aRow, 1, ''..i..'', true, false) 
                 guiGridListSetItemText(Gblue, aRow, 2, getPlayerName(playerValue), true, false) 
        end 
end 

Link to comment
local theTeam = getTeamFromName("Blue") 
if (theTeam) then 
        local players = getPlayersInTeam(theTeam) 
        guiGridListClear(Gblue) 
        for playerKey, playerValue in ipairs(players) do 
                 local aRow = guiGridListAddRow(Gblue) 
                 guiGridListSetItemText(Gblue, aRow, 1, ''..i..'', true, false) 
                 guiGridListSetItemText(Gblue, aRow, 2, getPlayerName(playerValue), true, false) 
        end 
end 

لا يعمل

فى كود شبه ذا سويته من الويكي ما يعمل بردو :cry:

Link to comment

#جرب

function ShowGridList ( ) 
    local theTeam = getTeamFromName("Blue") 
    if ( theTeam ) then 
        local players = getPlayersInTeam ( theTeam ) 
        guiGridListClear ( Gblue ) 
        for playerKey, playerValue in ipairs(players) do 
            local aRow = guiGridListAddRow(Gblue) 
            guiGridListSetItemText(Gblue, aRow, 1, ''..playerKey..'', true, false) 
            guiGridListSetItemText(Gblue, aRow, 2, getPlayerName(playerValue), true, false) 
        end 
    end 
end 
  
setTimer ( ShowGridList, 100, 1 ) 
addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) 
addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) 
addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) 
Link to comment
#جرب

function ShowGridList ( ) 
    local theTeam = getTeamFromName("Blue") 
    if ( theTeam ) then 
        local players = getPlayersInTeam ( theTeam ) 
        guiGridListClear ( Gblue ) 
        for playerKey, playerValue in ipairs(players) do 
            local aRow = guiGridListAddRow(Gblue) 
            guiGridListSetItemText(Gblue, aRow, 1, ''..playerKey..'', true, false) 
            guiGridListSetItemText(Gblue, aRow, 2, getPlayerName(playerValue), true, false) 
        end 
    end 
end 
  
setTimer ( ShowGridList, 100, 1 ) 
addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) 
addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) 
addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) 

للأسف

Ww8GwX.png

Link to comment
function ShowGridList ( ) 
    local theTeam = getTeamFromName("Blue") 
    guiGridListClear ( Gblue ) 
    for k, v in ipairs( getElementsByType ("player") ) do 
        if getPlayerTeam ( v ) == theTeam then 
            guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 1, k, true, false) 
            guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 2, getPlayerName(v), true, false) 
        end 
    end 
end 
  
setTimer ( ShowGridList, 100, 1 ) 
addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) 
addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) 
addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) 

Link to comment
function ShowGridList ( ) 
    local theTeam = getTeamFromName("Blue") 
    guiGridListClear ( Gblue ) 
    for k, v in ipairs( getElementsByType ("player") ) do 
        if getPlayerTeam ( v ) == theTeam then 
            guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 1, k, true, false) 
            guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 2, getPlayerName(v), true, false) 
        end 
    end 
end 
  
setTimer ( ShowGridList, 100, 1 ) 
addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) 
addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) 
addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) 

:cry:

Link to comment

getPlayersInTeam

+

تقدر تستفيد من مثال الويكي

function showTeamFunction ( command, teamName ) 
        -- Find and show all the players in the team that was specified with the console command 
        local theTeam = getTeamFromName ( teamName ) 
        if ( theTeam ) then 
                local players = getPlayersInTeam ( theTeam )  
                -- Loop through the player table 
                for playerKey, playerValue in ipairs ( players ) do 
                        outputChatBox ( getPlayerName(playerValue) ) 
                end 
        end 
end 
  
addCommandHandler ( "showTeam", showTeamFunction ) 
Link to comment
getPlayersInTeam

+

تقدر تستفيد من مثال الويكي

function showTeamFunction ( command, teamName ) 
        -- Find and show all the players in the team that was specified with the console command 
        local theTeam = getTeamFromName ( teamName ) 
        if ( theTeam ) then 
                local players = getPlayersInTeam ( theTeam )  
                -- Loop through the player table 
                for playerKey, playerValue in ipairs ( players ) do 
                        outputChatBox ( getPlayerName(playerValue) ) 
                end 
        end 
end 
  
addCommandHandler ( "showTeam", showTeamFunction ) 

يا تنطيل ولله انا قبل ما اطرح الموضوع هون

روحت على الويكي و جربت الكود 1000 مره

Link to comment
Gblue = guiCreateGridList(428, 226, 245, 167, false)          
 guiGridListAddColumn(Gblue, "#", 0.2)         
 guiGridListAddColumn(Gblue, "player", 0.7)      
 guiSetAlpha(Gblue, 0.80)       
 guiSetVisible ( Gblue , false )  
  
  
  
  
  
Gred = guiCreateGridList(167, 228, 245, 167, false) 
  
guiSetVisible ( Gred, false ) 
guiSetAlpha(Gred, 0.80) 
 guiGridListAddColumn(Gred, "#", 0.2)      
 guiGridListAddColumn(Gred, "Player", 0.7)   
   
  
  
     
    function ShowGridList2 ( ) 
        local theTeam = getTeamFromName("Red") 
        guiGridListClear ( Gred ) 
        for k, v in ipairs( getElementsByType ("player") ) do 
            if getPlayerTeam ( v ) == theTeam then 
                guiGridListSetItemText(Gred, guiGridListAddRow(Gred), 1, k, true, false) 
                guiGridListSetItemText(Gred, guiGridListAddRow(Gred), 2, getPlayerName(v), true, false) 
            end 
        end 
    end 
      
    setTimer ( ShowGridList2, 100, 1 ) 
    addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList2 ) 
    addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList2 ) 
    addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList2 ) 
  
    function ShowGridList ( ) 
        local theTeam = getTeamFromName("Blue") 
        guiGridListClear ( Gblue ) 
        for k, v in ipairs( getElementsByType ("player") ) do 
            if getPlayerTeam ( v ) == theTeam then 
                guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 1, k, true, false) 
                guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 2, getPlayerName(v), true, false) 
            end 
        end 
    end 
      
    setTimer ( ShowGridList, 100, 1 ) 
    addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) 
    addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) 
    addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) 
  
  
  

server

TRed = createTeam ("Red",255,0,0) 
Tblue = createTeam ("Blue",0,0,255) 
  

Edited by Guest
Link to comment

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