Jump to content

طلب اكواد بسيطة


Recommended Posts

السلام عليكم

شباب ابي كود اذا كتب كلمة وهو من تيم معين يسوي حركة

وكود اذا كنت بتيم تقدر تقتل بس تيمات محددة

يعني انا شرطي اقدر اقتل

حرامية وتيم اخر

Link to comment

لم يتم التجربة

-- Client Side 
AllowedTeams = {  
    ["Police"] = { "Grove", "Medic" }; 
    ["Medic"] = { "Ballas", "No Team", "Grove", "Police" }; 
 --["اسم التيم] = { "x التيمات اللي مايقدر يهاجمها" }; 
}; 
  
addEventHandler ( "onClientPlayerDamage", localPlayer, 
    function ( attacker ) 
        if attacker then 
            if getElementType ( attacker ) == "player" then 
                local sourceTeam, attackerTeam = getPlayerTeam ( source ), getPlayerTeam ( attacker ) 
                if sourceTeam and attackerTeam then 
                    local allowTeams = AllowedTeams[ getTeamName ( attackerTeam ) ] 
                    if allowTeams then 
                        for index, value in ipairs ( allowTeams ) do 
                            if value == getTeamName ( sourceTeam ) then 
                                cancelEvent ( ) 
                                break 
                            end 
                        end 
                    end 
                end 
            end 
        end 
    end 
) 

Link to comment
لم يتم التجربة
-- Client Side 
AllowedTeams = {  
    ["Police"] = { "Grove", "Medic" }; 
    ["Medic"] = { "Ballas", "No Team", "Grove", "Police" }; 
 --["اسم التيم] = { "x التيمات اللي مايقدر يهاجمها" }; 
}; 
  
addEventHandler ( "onClientPlayerDamage", localPlayer, 
    function ( attacker ) 
        if attacker then 
            if getElementType ( attacker ) == "player" then 
                local sourceTeam, attackerTeam = getPlayerTeam ( source ), getPlayerTeam ( attacker ) 
                if sourceTeam and attackerTeam then 
                    local allowTeams = AllowedTeams[ getTeamName ( attackerTeam ) ] 
                    if allowTeams then 
                        for index, value in ipairs ( allowTeams ) do 
                            if value == getTeamName ( sourceTeam ) then 
                                cancelEvent ( ) 
                                break 
                            end 
                        end 
                    end 
                end 
            end 
        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...