Jump to content

طلب كود


Stranger

Recommended Posts

--> server

addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), 
    function ( player ) 
        if ( getElementType ( player ) == "player" ) then 
            for i,Teams in ipairs ( getElementsByType ( "team" ) ) do 
                local team = getTeamFromName ( "إسمـ الفريق" ) 
                if ( team ) then 
                    outputChatBox( "A team with the same name already exist !!", player, 255, 0, 0, true ) 
                    setTeamFriendlyFire( "إسمـ الفريق", false ) 
                else 
                    createTeam( "إسمـ الفريق", 255, 0, 0 ) 
                    setTeamFriendlyFire( "إسمـ الفريق", false ) 
                end 
            end 
        end 
    end 
) 

:D بدل "إسمـ الفريق " بإسمـ فريقك وبيشتغل إن شاء الله

Link to comment
--> server
addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), 
    function ( player ) 
        if ( getElementType ( player ) == "player" ) then 
            for i,Teams in ipairs ( getElementsByType ( "team" ) ) do 
                local team = getTeamFromName ( "إسمـ الفريق" ) 
                if ( team ) then 
                    outputChatBox( "A team with the same name already exist !!", player, 255, 0, 0, true ) 
                    setTeamFriendlyFire( "إسمـ الفريق", false ) 
                else 
                    createTeam( "إسمـ الفريق", 255, 0, 0 ) 
                    setTeamFriendlyFire( "إسمـ الفريق", false ) 
                end 
            end 
        end 
    end 
) 

:D بدل "إسمـ الفريق " بإسمـ فريقك وبيشتغل إن شاء الله

lol?

Link to comment

كذا صح ؟ لو فيه خطأ عدلوه لاهنتم

function createTeamTeamOnStart () 
    TeamTeam = createTeam ( "Team", 0, 255, 0 ) 
end 
addEventHandler("onResourceStart", resourceRoot, createTeamTeamOnStart)  
  
function setTeamTeam() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(هنا اسم الحساب)) then  
   setPlayerTeam(هنا اسم الحساب, Team)  
   end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setTeamTeam) 

Link to comment

إذا تبيه لحساب مخصص بقروب أدمن يصير كذآ

Team = createTeam ( "Team", 0, 255, 0 ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( ) 
        if isObjectInACLGroup ( "user.اسم الحساب", aclGetGroup ( "Admin" ) ) then 
            setPlayerTeam ( source, Team ) 
        end 
    end 
) 

أما إذا تبيه لأي حساب بقروب الأدمن يصير كذآ

Team = createTeam ( "Team", 0, 255, 0 ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( ) 
        if isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) then 
            setPlayerTeam ( source, Team ) 
        end 
    end 
) 

وإذا تبيه لقروبات ثانية قلي #

Link to comment
TeamTeam = createTeam ( "Team", 0, 255, 0 ) 
      
function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 
    if RealAccount == "الحساب" then 
        setPlayerTeam ( source, TeamTeam ) 
    end 
end 
addEventHandler ( "onPlayerLogin", root, setTeamTeam ) 

الوظايف هذي

getAccountName 
getPlayerAccount 

ماتحتاجها . . ليه ؟

Parameters لأن في نفس الإيفنت هذا

والباراميترس مثل مانقول بالعامية هي المعرّفات " بـ شد الـ ر

و عندك 3 معرفات جاهزة

Ps:

thePreviousAccount: The account the player was logged into before

theCurrentAccount: The account the player logged into just now

autoLogin: Whether this login was a result of an autologin

طبعاً هذي اللي تضيفها بـ أقواس الفنكشن مثل ماهو عندك بالكود

function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 

طبعاً مو ضروري نفس الإسم يطابقه حرف حرف

واتمنى كلامي مافيه اخطاء = )

Link to comment
إذا تبيه لحساب مخصص بقروب أدمن يصير كذآ
Team = createTeam ( "Team", 0, 255, 0 ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( ) 
        if isObjectInACLGroup ( "user.اسم الحساب", aclGetGroup ( "Admin" ) ) then 
            setPlayerTeam ( source, Team ) 
        end 
    end 
) 

أما إذا تبيه لأي حساب بقروب الأدمن يصير كذآ

Team = createTeam ( "Team", 0, 255, 0 ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( ) 
        if isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) then 
            setPlayerTeam ( source, Team ) 
        end 
    end 
) 

وإذا تبيه لقروبات ثانية قلي #

يا اسامه انا ابيه يعني احط حساب معين مو لازم في قروب ادمن حصاب عادي

Link to comment
إذا تبيه لحساب مخصص بقروب أدمن يصير كذآ
Team = createTeam ( "Team", 0, 255, 0 ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( ) 
        if isObjectInACLGroup ( "user.اسم الحساب", aclGetGroup ( "Admin" ) ) then 
            setPlayerTeam ( source, Team ) 
        end 
    end 
) 

أما إذا تبيه لأي حساب بقروب الأدمن يصير كذآ

Team = createTeam ( "Team", 0, 255, 0 ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( ) 
        if isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) then 
            setPlayerTeam ( source, Team ) 
        end 
    end 
) 

وإذا تبيه لقروبات ثانية قلي #

يا اسامه انا ابيه يعني احط حساب معين مو لازم في قروب ادمن حساب عادي

Link to comment
TeamTeam = createTeam ( "Team", 0, 255, 0 ) 
      
function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 
    if RealAccount == "الحساب" then 
        setPlayerTeam ( source, TeamTeam ) 
    end 
end 
addEventHandler ( "onPlayerLogin", root, setTeamTeam ) 

الوظايف هذي

getAccountName 
getPlayerAccount 

ماتحتاجها . . ليه ؟

Parameters لأن في نفس الإيفنت هذا

والباراميترس مثل مانقول بالعامية هي المعرّفات " بـ شد الـ ر

و عندك 3 معرفات جاهزة

Ps:

thePreviousAccount: The account the player was logged into before

theCurrentAccount: The account the player logged into just now

autoLogin: Whether this login was a result of an autologin

طبعاً هذي اللي تضيفها بـ أقواس الفنكشن مثل ماهو عندك بالكود

function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 

طبعاً مو ضروري نفس الإسم يطابقه حرف حرف

واتمنى كلامي مافيه اخطاء = )

تسلم يا عناد

Link to comment
TeamTeam = createTeam ( "Team", 0, 255, 0 ) 
      
function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 
    if RealAccount == "الحساب" then 
        setPlayerTeam ( source, TeamTeam ) 
    end 
end 
addEventHandler ( "onPlayerLogin", root, setTeamTeam ) 

الوظايف هذي

getAccountName 
getPlayerAccount 

ماتحتاجها . . ليه ؟

Parameters لأن في نفس الإيفنت هذا

والباراميترس مثل مانقول بالعامية هي المعرّفات " بـ شد الـ ر

و عندك 3 معرفات جاهزة

Ps:

thePreviousAccount: The account the player was logged into before

theCurrentAccount: The account the player logged into just now

autoLogin: Whether this login was a result of an autologin

طبعاً هذي اللي تضيفها بـ أقواس الفنكشن مثل ماهو عندك بالكود

function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 

طبعاً مو ضروري نفس الإسم يطابقه حرف حرف

واتمنى كلامي مافيه اخطاء = )

تسلم يا عناد

بس ماضبط

Link to comment
Team = createTeam( "Team", 0, 255, 0 ) 
  
addEventHandler( "onPlayerLogin", root, 
    function ( theCurrentAccount ) 
        if ( theCurrentAccount == "user.إسم الحساب" ) then 
            setPlayerTeam( source, "Team" ) 
        end 
    end 
) 

Link to comment
TeamTeam = createTeam ( "Team", 0, 255, 0 ) 
      
function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 
    if RealAccount == "الحساب" then 
        setPlayerTeam ( source, TeamTeam ) 
    end 
end 
addEventHandler ( "onPlayerLogin", root, setTeamTeam ) 

الوظايف هذي

getAccountName 
getPlayerAccount 

ماتحتاجها . . ليه ؟

Parameters لأن في نفس الإيفنت هذا

والباراميترس مثل مانقول بالعامية هي المعرّفات " بـ شد الـ ر

و عندك 3 معرفات جاهزة

Ps:

thePreviousAccount: The account the player was logged into before

theCurrentAccount: The account the player logged into just now

autoLogin: Whether this login was a result of an autologin

طبعاً هذي اللي تضيفها بـ أقواس الفنكشن مثل ماهو عندك بالكود

function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 

طبعاً مو ضروري نفس الإسم يطابقه حرف حرف

واتمنى كلامي مافيه اخطاء = )

^ Wrong -_-"

=============

Parametersلو يبي تستخدم الـ

يصصير كذآ ,

-- Server Side !

Team = createTeam ( "Team", 0, 255, 0 ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( _, Account ) 
        if getAccountName ( Account ) == "إسم الحساب" then 
            setPlayerTeam( source, Team ) 
        end 
    end 
) 

Link to comment
TeamTeam = createTeam ( "Team", 0, 255, 0 ) 
      
function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 
    if RealAccount == "الحساب" then 
        setPlayerTeam ( source, TeamTeam ) 
    end 
end 
addEventHandler ( "onPlayerLogin", root, setTeamTeam ) 

الوظايف هذي

getAccountName 
getPlayerAccount 

ماتحتاجها . . ليه ؟

Parameters لأن في نفس الإيفنت هذا

والباراميترس مثل مانقول بالعامية هي المعرّفات " بـ شد الـ ر

و عندك 3 معرفات جاهزة

Ps:

thePreviousAccount: The account the player was logged into before

theCurrentAccount: The account the player logged into just now

autoLogin: Whether this login was a result of an autologin

طبعاً هذي اللي تضيفها بـ أقواس الفنكشن مثل ماهو عندك بالكود

function setTeamTeam ( PrivousAccount, RealAccount, AutoLogin ) 

طبعاً مو ضروري نفس الإسم يطابقه حرف حرف

واتمنى كلامي مافيه اخطاء = )

^ Wrong -_-"

=============

Parametersلو يبي تستخدم الـ

يصصير كذآ ,

-- Server Side !

Team = createTeam ( "Team", 0, 255, 0 ) 
  
addEventHandler ( "onPlayerLogin", root, 
    function ( _, Account ) 
        if getAccountName ( Account ) == "إسم الحساب" then 
            setPlayerTeam( source, Team ) 
        end 
    end 
) 

تسلم يالغالي اشتغل بس فيه شي لو ابي اضيف حساب ثاني يصير كذا ؟

        if getAccountName ( Account ) == "اسم الحساب" or if getAccountName ( Account ) == "اسم الحساب" then 

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