Jump to content

searchplayers استفسار عن


Recommended Posts

بسم الله الرحمن الرحيم

السلام عليكم ورحمة الله وبركاته

اخواني اانا بحثت بالويكي مالقيت شرح لل

searchplayers

مثلا انا بسوي شوب وبحط تحت فراغ

Editor

حلو وابغى بحث عن الاعبين انا دورته مالقيته بالويكي ان شاء الله فهمتو

ومشكورين مقدماُ

Link to comment
بسم الله الرحمن الرحيم

السلام عليكم ورحمة الله وبركاته

اخواني اانا بحثت بالويكي مالقيت شرح لل

searchplayers

مثلا انا بسوي شوب وبحط تحت فراغ

Editor

حلو وابغى بحث عن الاعبين انا دورته مالقيته بالويكي ان شاء الله فهمتو

ومشكورين مقدماُ

string.find

http://www.lua.org/pil/20.1.html

Link to comment
function createPlayerList () 
    --عمل جدول اللاعبين 
    local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) 
    --عمل عمود لاسماء اللاعبين 
    local column = guiGridListAddColumn( playerList, "Player", 0.85 ) 
    if ( column ) then --If the column has been created, fill it with players 
        for id, player in ipairs(getElementsByType("player")) do --- البحث عن جميع اللاعبين 
            local row = guiGridListAddRow ( playerList ) -- اضافة سطر جديد 
            guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) -- وضع اسم اللاعب بالسطر 
        end 
    end 
end 

المصدر

http://wiki.multitheftauto.com/wiki/GuiCreateGridList

Edited by Guest
Link to comment
  
  
  
addEventHandler("onClientResourceStart",resourceRoot, 
  
    function () 
  
        theWindow = guiCreateWindow(240, 200, 550, 330, "", false) 
  
        searchPlayer = guiCreateEdit(15, 25, 180, 20, "",false, theWindow) 
  
        addEventHandler ("onClientGUIChanged", searchPlayer, findPlayers, false) 
  
        playersList = guiCreateGridList(10, 50, 500, 210, false, theWindow) 
  
        guiGridListAddColumn(playersList,"Player name:",0.90) 
  
        for index, player in ipairs(getElementsByType("player")) do 
  
            local playerRow = guiGridListAddRow(playersList) 
  
            guiGridListSetItemText(playersList, playerRow, 1, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false) 
  
        end 
  
    end 
  
) 
  
  
  
function findPlayers () 
  
    guiGridListClear( playersList ) 
  
    local text = guiGetText ( source ) 
  
    if (text ~= "") then 
  
        for index, player in ipairs (getElementsByType("player")) do 
  
        local playerRow = guiGridListAddRow(playersList) 
  
        local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") 
  
        if ( string.find ( string.upper ( playerName ), string.upper ( text ), 1, true ) ) then 
  
            guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) 
  
        else 
  
            guiGridListSetItemText(playersList, playerRow, 1, "No player found.", false, false) 
  
            break 
  
        end 
  
    end 
  
else 
  
    for index, player in ipairs (getElementsByType("player")) do 
  
        local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") 
  
        local playerRow = guiGridListAddRow(playersList) 
  
        guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) 
  
        end 
  
    end 
  
end 
  
  
  

Link to comment
بسم الله الرحمن الرحيم

السلام عليكم ورحمة الله وبركاته

اخواني اانا بحثت بالويكي مالقيت شرح لل

searchplayers

مثلا انا بسوي شوب وبحط تحت فراغ

Editor

حلو وابغى بحث عن الاعبين انا دورته مالقيته بالويكي ان شاء الله فهمتو

ومشكورين مقدماُ

string.find

http://www.lua.org/pil/20.1.html

انا مادري كيف تفهمون حق هاذي الصفحات انا ابدآً مو عارف ياريت تشرحلي شيء بسيط منها او تفهمني كيف افهم منها مو داخله عقلي ابد

Link to comment
function createPlayerList () 
    --عمل جدول اللاعبين 
    local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) 
    --عمل عمود لاسماء اللاعبين 
    local column = guiGridListAddColumn( playerList, "Player", 0.85 ) 
    if ( column ) then --If the column has been created, fill it with players 
        for id, player in ipairs(getElementsByType("player")) do --- البحث عن جميع اللاعبين 
            local row = guiGridListAddRow ( playerList ) -- اضافة سطر جديد 
            guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) -- وضع اسم اللاعب بالسطر 
        end 
    end 
end 

المصدر

http://wiki.multitheftauto.com/wiki/GuiCreateGridList

اخوي وين البحث؟؟

Link to comment
  
  
  
addEventHandler("onClientResourceStart",resourceRoot, 
  
    function () 
  
        theWindow = guiCreateWindow(240, 200, 550, 330, "", false) 
  
        searchPlayer = guiCreateEdit(15, 25, 180, 20, "",false, theWindow) 
  
        addEventHandler ("onClientGUIChanged", searchPlayer, findPlayers, false) 
  
        playersList = guiCreateGridList(10, 50, 500, 210, false, theWindow) 
  
        guiGridListAddColumn(playersList,"Player name:",0.90) 
  
        for index, player in ipairs(getElementsByType("player")) do 
  
            local playerRow = guiGridListAddRow(playersList) 
  
            guiGridListSetItemText(playersList, playerRow, 1, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false) 
  
        end 
  
    end 
  
) 
  
  
  
function findPlayers () 
  
    guiGridListClear( playersList ) 
  
    local text = guiGetText ( source ) 
  
    if (text ~= "") then 
  
        for index, player in ipairs (getElementsByType("player")) do 
  
        local playerRow = guiGridListAddRow(playersList) 
  
        local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") 
  
        if ( string.find ( string.upper ( playerName ), string.upper ( text ), 1, true ) ) then 
  
            guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) 
  
        else 
  
            guiGridListSetItemText(playersList, playerRow, 1, "No player found.", false, false) 
  
            break 
  
        end 
  
    end 
  
else 
  
    for index, player in ipairs (getElementsByType("player")) do 
  
        local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") 
  
        local playerRow = guiGridListAddRow(playersList) 
  
        guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) 
  
        end 
  
    end 
  
end 
  
  
  

مشكور ماقصرت جاري التجربه

Link to comment
  
  
  
addEventHandler("onClientResourceStart",resourceRoot, 
  
    function () 
  
        theWindow = guiCreateWindow(240, 200, 550, 330, "", false) 
  
        searchPlayer = guiCreateEdit(15, 25, 180, 20, "",false, theWindow) 
  
        addEventHandler ("onClientGUIChanged", searchPlayer, findPlayers, false) 
  
        playersList = guiCreateGridList(10, 50, 500, 210, false, theWindow) 
  
        guiGridListAddColumn(playersList,"Player name:",0.90) 
  
        for index, player in ipairs(getElementsByType("player")) do 
  
            local playerRow = guiGridListAddRow(playersList) 
  
            guiGridListSetItemText(playersList, playerRow, 1, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false) 
  
        end 
  
    end 
  
) 
  
  
  
function findPlayers () 
  
    guiGridListClear( playersList ) 
  
    local text = guiGetText ( source ) 
  
    if (text ~= "") then 
  
        for index, player in ipairs (getElementsByType("player")) do 
  
        local playerRow = guiGridListAddRow(playersList) 
  
        local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") 
  
        if ( string.find ( string.upper ( playerName ), string.upper ( text ), 1, true ) ) then 
  
            guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) 
  
        else 
  
            guiGridListSetItemText(playersList, playerRow, 1, "No player found.", false, false) 
  
            break 
  
        end 
  
    end 
  
else 
  
    for index, player in ipairs (getElementsByType("player")) do 
  
        local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") 
  
        local playerRow = guiGridListAddRow(playersList) 
  
        guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) 
  
        end 
  
    end 
  
end 
  
  
  

Link to comment
  
  
  
addEventHandler("onClientResourceStart",resourceRoot, 
  
    function () 
  
        theWindow = guiCreateWindow(240, 200, 550, 330, "", false) 
  
        searchPlayer = guiCreateEdit(15, 25, 180, 20, "",false, theWindow) 
  
        addEventHandler ("onClientGUIChanged", searchPlayer, findPlayers, false) 
  
        playersList = guiCreateGridList(10, 50, 500, 210, false, theWindow) 
  
        guiGridListAddColumn(playersList,"Player name:",0.90) 
  
        for index, player in ipairs(getElementsByType("player")) do 
  
            local playerRow = guiGridListAddRow(playersList) 
  
            guiGridListSetItemText(playersList, playerRow, 1, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false) 
  
        end 
  
    end 
  
) 
  
  
  
function findPlayers () 
  
    guiGridListClear( playersList ) 
  
    local text = guiGetText ( source ) 
  
    if (text ~= "") then 
  
        for index, player in ipairs (getElementsByType("player")) do 
  
        local playerRow = guiGridListAddRow(playersList) 
  
        local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") 
  
        if ( string.find ( string.upper ( playerName ), string.upper ( text ), 1, true ) ) then 
  
            guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) 
  
        else 
  
            guiGridListSetItemText(playersList, playerRow, 1, "No player found.", false, false) 
  
            break 
  
        end 
  
    end 
  
else 
  
    for index, player in ipairs (getElementsByType("player")) do 
  
        local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") 
  
        local playerRow = guiGridListAddRow(playersList) 
  
        guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) 
  
        end 
  
    end 
  
end 
  
  
  

وشش الجديد عن ككود بسول ؟

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