Jump to content

تصحيح كود


bshr1997

Recommended Posts

السلام عليكم

كل عام وانتو بخير

المهم

اخواني في ذا الكود من اخوي عاشق الشرق

سيرفر:

addEventHandler ( 
    'onResourceStart', resourceRoot, 
    function ( ) 
        for k, v in ipairs ( getElementsByType ( 'player' ) ) do 
            if ( v ) then 
                bindKey ( v, 'F4', 'down', ChangeTeam ) 
            end 
        end 
    end 
) 
  
addEventHandler ( 
    'onPlayerJoin', getRootElement( ), 
    function ( ) 
        bindKey ( source, 'F4', 'down', ChangeTeam ) 
    end 
) 
  
addEventHandler ( 
    'onPlayerWasted', getRootElement( ), 
    function ( ) 
        if ( getElementData ( source, 'ChangeTeam' ) == true ) then 
            JoinRandomTeam( source ) 
            setElementData ( source, 'ChangeTeam', false ) 
        end 
    end 
) 
  
function getRandomTeam ( ) 
  return getTeamName ( getElementsByType( "team" )[ math.random( 1, #getElementsByType( "team" ) ) ] or false ) 
end 
  
function JoinRandomTeam( player ) 
    setPlayerTeam ( player, getTeamFromName ( getRandomTeam ( ) ) ) 
end 
  
function ChangeTeam ( player ) 
    if ( getElementData ( player, 'ChangeTeam' ) == false ) or ( not getElementData ( player, 'ChangeTeam' ) ) then 
        outputChatBox ( '*[server] سوف يتم تحويلك التيم الآخر بعد أن تموت', player, 255, 0, 0, true ) 
        setElementData ( player, 'ChangeTeam', true ) 
    elseif ( getElementData ( player, 'ChangeTeam' ) == true ) then 
        outputChatBox ( '*[server] إلغاء تحويل التيم', player, 255, 0, 255, true ) 
        setElementData ( player, 'ChangeTeam', false ) 
    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...