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' )
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
addEventHandler( 'onPlayerSpawn', root,
function( )
for i = 69, 79 do
setPedStat( source, i, 0 )
end
end )
for _, Player in ipairs( getElementsByType( 'player' ) ) do
for i = 69, 79 do
setPedStat( Player, i, 0 )
end
end