Jump to content

x[ استفسار ]x ابي احد يشرحلي ماهو اللوب


Avir14

Recommended Posts

for Key, Player in ipairs( getElementsByType ( 'player' ) ) do 
  if ( getPlayerName( Player ) == 'Avir14' ) then 
    outputChatBox( "Welcome", Player )
  end
end

 


for Key, Player in ipairs( getElementsByType ( 'player' ) ) do 
  if ( getElementData( Player, 'ID' ) == 5 ) then 
    outputChatBox( "Welcome", Player )
  end
end

 

  • Thanks 1
Link to comment
1 hour ago, #Soking said:
for Key, Player in ipairs( getElementsByType ( 'player' ) ) do 
  if ( getPlayerName( Player ) == 'Avir14' ) then 
    outputChatBox( "Welcome", Player )
  end
end

 


for Key, Player in ipairs( getElementsByType ( 'player' ) ) do 
  if ( getElementData( Player, 'ID' ) == 5 ) then 
    outputChatBox( "Welcome", Player )
  end
end

 

سؤال اعدرني كيف اجيب اعلا شخص معه ايدي فلسيرفر لما اسوي اللوب

Link to comment
36 minutes ago, Avir14 said:

سؤال اعدرني كيف اجيب اعلا شخص معه ايدي فلسيرفر لما اسوي اللوب

function getBigPlayer( )
	local BigID, LastPlayer = 0
  for _, Player in ipairs( getElementsByType( 'player' ) ) do
      local PlayerID = getElementData( Player, 'ID' ) or 0
      if ( PlayerID and PlayerID > BigID ) then
        BigID, LastPlayer = PlayerID, Player
    end
  end
  return LastPlayer
end


-- Test

local aPlayer = getBigPlayer( )
outputChatBox( aPlayer and getPlayerName( aPlayer ) or 'None' )

 

Edited by #Soking
  • Like 1
Link to comment
On 16/08/2023 at 23:34, #Soking said:
function getBigPlayer( )
	local BigID, LastPlayer = 0
  for _, Player in ipairs( getElementsByType( 'player' ) ) do
      local PlayerID = getElementData( Player, 'ID' ) or 0
      if ( PlayerID and PlayerID > BigID ) then
        BigID, LastPlayer = PlayerID, Player
    end
  end
  return LastPlayer
end


-- Test

local aPlayer = getBigPlayer( )
outputChatBox( aPlayer and getPlayerName( aPlayer ) or 'None' )

 

اقتراح بس ضيف فنكيشن

لما الحدث ينقل اللاعب 

warp

لمكان اخر  هو انا مش فاهم بقول اية بس بحاول اعمل نفسى مبرمج

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