Jump to content

[Request] fix getPlayerName - اكواد اسم الاعب


Recommended Posts

آلسسلآم عليككم ..

بدون مقدمات ...

عندي اسوي اذا حدد اسم من القريد لست ..

يجي اسمه في لابل + السريال ..

لاكن م يجي شي

عـ آلعموم هذآ آلكود ..

addEventHandler("onClientGUIClick", resourceRoot, 
 function() 
    if (source == GUIEditor.gridlist[1]) then 
        local sel = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
        local text = guiGridListGetItemData(GUIEditor.gridlist[1],sel,1) 
        local player = getPlayerFromName(text) 
        if (player) then 
            triggerServerEvent("getSerial", localPlayer, player) 
        end 
    end 
end) 
  
  
addEvent("setSerial",true) 
addEventHandler("setSerial", root, 
 function(Name, Serial) 
    guiSetText(GUIEditor.label[2],"Name: "..Name ) 
    guiSetText(GUIEditor.label[3]",Serial: "..Serial) 
end) 

addEvent("getSerial",true) 
addEventHandler("getSerial", root, 
 function(player) 
    local playerName = getPlayerName(player) 
    local playerSerial = getPlayerSerial(player) 
    triggerClientEvent(source,"setSerial", source, playerName, playerSerial) 
end) 

دي بق : WARNING: bl/c,lua:133: Bad argument @ 'getPlayerFromName' [Expected string at argument 1, got nil

Link to comment

تمام , سويته انا

بس لما بحدد اسم بعدين اشيلو

يجي اسم وسريالي

انا ابي

N/A

م ظبت

addEventHandler("onClientGUIClick", resourceRoot, 
 function() 
    if (source == GUIEditor.gridlist[1]) then 
        local sel = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
        if ( sel ~= 1 ) then 
        local text = guiGridListGetItemText(GUIEditor.gridlist[1],sel,1) 
        if ( text and text ~= "" ) then 
         local player = getPlayerFromName(text) 
         if (player) then 
            triggerServerEvent("getSerial", localPlayer, player) 
           else 
           guiSetText(GUIEditor.label[2],"Name : N/A") 
           guiSetText(GUIEditor.label[3],"Serial : N/A") 
        end 
      end 
    end 
  end 
end ) 

Link to comment
addEventHandler("onClientGUIClick", resourceRoot, 
    function() 
        if (source = GUIEditor.gridlist[1]) then 
            local sel = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
            local text = guiGridListGetItemText(GUIEditor.gridlist[1],sel,1) 
            if ( text and text ~= "" ) then 
                local player = getPlayerFromName(text) 
                if (player) then 
                triggerServerEvent("getSerial", localPlayer, player) 
                end 
            else 
                guiSetText(GUIEditor.label[2],"Name : N/A") 
                guiSetText(GUIEditor.label[3],"Serial : N/A") 
            end 
        end 
    end 
) 

Link to comment
addEventHandler("onClientGUIClick", resourceRoot, 
    function() 
        if (source = GUIEditor.gridlist[1]) then 
            local sel = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
            local text = guiGridListGetItemText(GUIEditor.gridlist[1],sel,1) 
            if ( text and text ~= "" ) then 
                local player = getPlayerFromName(text) 
                if (player) then 
                triggerServerEvent("getSerial", localPlayer, player) 
                end 
            else 
                guiSetText(GUIEditor.label[2],"Name : N/A") 
                guiSetText(GUIEditor.label[3],"Serial : N/A") 
            end 
        end 
    end 
) 

تحققك كذا ما ينفع يا عزيزي لان ما سويت تحقق اذا مختار شي او لأ اصلأ ! .. اعتقد ان صاحب الموضوع انحلت المشكلة معاهـ خلاص

Link to comment

addEventHandler("onClientGUIClick",resourceRoot, function ( ) 
if ( source == GUIEditor.gridlist[1] ) then  
local Select_ = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) 
if ( Select_ ~= -1 ) then  
if ( getPlayerFromName ( guiGridListGetItemText(GUIEditor.gridlist[1],Select_,1) ) ) then  
triggerServerEvent("getSerial", localPlayer,getPlayerFromName(guiGridListGetItemText(GUIEditor.gridlist[1],Select_,1))) 
end 
else 
guiSetText(GUIEditor.label[2],"Name : N/A") 
guiSetText(GUIEditor.label[3],"Serial : N/A") 
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...