Jump to content

تمت الافاده | كود القريد ليست


Recommended Posts

اول شي لازم تحط كل اللاعبين في القريد لست

موجود في مثال الويكي

https://wiki.multitheftauto.com/wiki/GuiGridListSetItemText

هذا لتحديث القائمة

You can use this and be sure to replace gridList and column with your.
function updateList(old, new) 
    if eventName == "onClientPlayerJoin"  then 
        local row = guiGridListAddRow(gridList) 
        guiGridListSetItemText(gridList, row, column, getPlayerName(source), false, false) 
    elseif eventName == "onClientPlayerQuit"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == getPlayerName(source) then 
                guiGridListRemoveRow(gridList, i) 
            end 
        end 
    elseif eventName == "onClientPlayerChangeNick"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == old then 
                guiGridListSetItemText(gridList, i, column, new, false, false) 
            end 
        end 
    end 
end 
addEventHandler("onClientPlayerJoin", root, updateList) 
addEventHandler("onClientPlayerQuit", root, updateList) 
addEventHandler("onClientPlayerChangeNick", root, updateList) 

Link to comment

كيف احط الاعبين في القريد ليست

++++++++++++++++++++++++++++++++++++++++

احط ذا الكوود وين

function updateList(old, new) 
    if eventName == "onClientPlayerJoin"  then 
        local row = guiGridListAddRow(gridList) 
        guiGridListSetItemText(gridList, row, column, getPlayerName(source), false, false) 
    elseif eventName == "onClientPlayerQuit"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == getPlayerName(source) then 
                guiGridListRemoveRow(gridList, i) 
            end 
        end 
    elseif eventName == "onClientPlayerChangeNick"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == old then 
                guiGridListSetItemText(gridList, i, column, new, false, false) 
            end 
        end 
    end 
end 
addEventHandler("onClientPlayerJoin", root, updateList) 
addEventHandler("onClientPlayerQuit", root, updateList) 
addEventHandler("onClientPlayerChangeNick", root, updateList) 

في

c.lua او s.lua

Link to comment

ردي فوق واضح

الكود الي يحط اللاعبين في القريد لست موجود في رابط الويكي الي انا حطيته

و الكود حق تحديث القائمة بعد واضح

كلهم كلينت

Link to comment
كيف احط الاعبين في القريد ليست

++++++++++++++++++++++++++++++++++++++++

احط ذا الكوود وين

function updateList(old, new) 
    if eventName == "onClientPlayerJoin"  then 
        local row = guiGridListAddRow(gridList) 
        guiGridListSetItemText(gridList, row, column, getPlayerName(source), false, false) 
    elseif eventName == "onClientPlayerQuit"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == getPlayerName(source) then 
                guiGridListRemoveRow(gridList, i) 
            end 
        end 
    elseif eventName == "onClientPlayerChangeNick"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == old then 
                guiGridListSetItemText(gridList, i, column, new, false, false) 
            end 
        end 
    end 
end 
addEventHandler("onClientPlayerJoin", root, updateList) 
addEventHandler("onClientPlayerQuit", root, updateList) 
addEventHandler("onClientPlayerChangeNick", root, updateList) 

في

c.lua او s.lua

الاسم مو مهم

حطه بملف الكلنت اللي بمودك

Link to comment

شباب انا حطيت ذا الكوود

function clientsideResourceStart () 
        local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) -- Create the grid list 
        local column = guiGridListAddColumn( playerList, "Player", 0.85 ) -- Create a 'players' column in the list 
        if ( column ) then -- If the column was successfully created 
                for id, playeritem in ipairs(getElementsByType("player")) do  
                --Loop through all the players, adding them to the table 
                        local row = guiGridListAddRow ( playerList ) 
                        guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) 
                end 
        end 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(), clientsideResourceStart  
  
function updateList(old, new) 
    if eventName == "onClientPlayerJoin"  then 
        local row = guiGridListAddRow(gridList) 
        guiGridListSetItemText(gridList, row, column, getPlayerName(source), false, false) 
    elseif eventName == "onClientPlayerQuit"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == getPlayerName(source) then 
                guiGridListRemoveRow(gridList, i) 
            end 
        end 
    elseif eventName == "onClientPlayerChangeNick"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == old then 
                guiGridListSetItemText(gridList, i, column, new, false, false) 
            end 
        end 
    end 
end 
addEventHandler("onClientPlayerJoin", root, updateList) 
addEventHandler("onClientPlayerQuit", root, updateList) 
addEventHandler("onClientPlayerChangeNick", root, updateList) 
  

في c.lua

و الكود ذا

function clientsideResourceStart () 
        local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) -- Create the grid list 
        local column = guiGridListAddColumn( playerList, "Player", 0.85 ) -- Create a 'players' column in the list 
        if ( column ) then -- If the column was successfully created 
                for id, playeritem in ipairs(getElementsByType("player")) do  
                --Loop through all the players, adding them to the table 
                        local row = guiGridListAddRow ( playerList ) 
                        guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) 
                end 
        end 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(), clientsideResourceStart ) 

في c.lua

TAPL الكوود الثاني جايبه من https://wiki.multitheftauto.com/wiki/Gu ... etItemText

الرابط الي انت ارسلته لي

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