Jump to content

تصحيح كود


Recommended Posts

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

سويت مود لما تختار أسم لاعب من القريد ليست تجي معلوماته على اليمين في الأبل,

الزبدهة سويت حقت الحساب وطلع فيها شي خربان

أنه لو ضغطت على اسمي بيجي حسابي حلو , بس لو ضغطت على اسم الاعب الثاني كمان بيجي حسابي نفس الشي

أنا ابيه لو ضغط على الاعب الثاني يجيبه حسابه واذا ضغط على اسمي يجيب حسابي

الكود

Client Side

function setAccount ( ) 
    if ( source == GridListStats ) then 
        row, col = guiGridListGetSelectedItem ( source ) 
        if ( row and col and row ~= -1 and col ~= -1 ) then 
            local playername = guiGridListGetItemText ( source, row, col ) 
            local thePlayer = getPlayerFromName ( playername ) 
            if ( thePlayer ) then 
    triggerServerEvent("getAccountName", thePlayer) 
          end 
        end 
    end 
end 
addEventHandler ( "onClientGUIDoubleClick", root, setAccount ) 
  
  
  
function Account( accName ) 
                guiSetText ( AccLabel, "Account : ".. tostring(accName) ) 
end 
addEvent("setAccountName", true) 
addEventHandler("setAccountName", root, Account) 

Server Side

function getAccountNameFunction( thePlayer ) 
    if not client then return end 
    local account = getPlayerAccount( client ) 
    local accName = getAccountName( account ) 
    if accName then 
        triggerClientEvent(client, "setAccountName", client, accName) 
    end 
end 
addEvent("getAccountName", true) 
addEventHandler("getAccountName", root, getAccountNameFunction) 

ومشكورين مقدما :lol:

Link to comment

addEventHandler ( "onClientGUIDoubleClick", root, function (    ) 
  if ( source == GridListStats ) then 
      if ( guiGridListGetSelectedItem ( source ) ~= -1 ) then 
          local player = guiGridListGetItemText ( source, guiGridListGetSelectedItem ( source ), 1 ) 
           if ( player ~= '' ) then 
                 triggerServerEvent( "getAccountName", localPlayer, player ) 
              end 
          end 
     end 
end ) 
  
  
addEvent( "setAccountName", true ) 
addEventHandler( "setAccountName", root, function( accName ) 
      guiSetText ( AccLabel, "Account : "..tostring( accName ) ) 
end ) 

addEvent( "getAccountName", true ) 
addEventHandler( "getAccountName", root, function( player ) 
  if ( isElement( getPlayerFromName( player ) ) ) then 
     local pAccount = getPlayerAccount( getPlayerFromName( player ) ) 
       if ( pAccount and not isGuestAccount( getPlayerFromName( player ) ) ) then 
             triggerClientEvent( source, "setAccountName", source, getAccountName( pAccount ) ) 
        end 
    end 
end ) 
Link to comment
addEventHandler ( "onClientGUIDoubleClick", root, function (    ) 
  if ( source == GridListStats ) then 
      if ( guiGridListGetSelectedItem ( source ) ~= -1 ) then 
          local player = guiGridListGetItemText ( source, guiGridListGetSelectedItem ( source ), 1 ) 
           if ( player ~= '' ) then 
                 triggerServerEvent( "getAccountName", localPlayer, player ) 
              end 
          end 
     end 
end ) 
  
  
addEvent( "setAccountName", true ) 
addEventHandler( "setAccountName", root, function( accName ) 
      guiSetText ( AccLabel, "Account : "..tostring( accName ) ) 
end ) 

addEvent( "getAccountName", true ) 
addEventHandler( "getAccountName", root, function( player ) 
  if ( isElement( getPlayerFromName( player ) ) ) then 
     local pAccount = getPlayerAccount( getPlayerFromName( player ) ) 
       if ( pAccount and not isGuestAccount( getPlayerFromName( player ) ) ) then 
             triggerClientEvent( source, "setAccountName", source, getAccountName( pAccount ) ) 
        end 
    end 
end ) 

مشكووووووور أخووي الكود شغال مية مية :shock:

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