Jump to content

طلب كود


Tarek1

Recommended Posts

Posted

السلام عليكم 

 لبعضهم البعض damage من نفس التيم لا يستطيعون ان يعملون Playersشباب ممكن كود يجعل ال 

Posted
33 minutes ago, Tarek1 said:

ممكن مثال يعني تكون لتيم البوليس ?

متال من ويكي 

-- get a table with all teams
local allTeams = getElementsByType ( "team" )
-- for every team,
for index, theTeam in ipairs(allTeams) do
	-- if friendly fire is off,
	if ( getTeamFriendlyFire ( theTeam ) == false ) then
		-- switch it on
		setTeamFriendlyFire ( theTeam, true )
	end
end

 

Posted
Just now, mahmod3 said:

متال من ويكي 


-- get a table with all teams
local allTeams = getElementsByType ( "team" )
-- for every team,
for index, theTeam in ipairs(allTeams) do
	-- if friendly fire is off,
	if ( getTeamFriendlyFire ( theTeam ) == false ) then
		-- switch it on
		setTeamFriendlyFire ( theTeam, true )
	end
end

 

"Police"انا جربتها بس مش عارف اعمل لل 

Posted
2 minutes ago, mahmod3 said:

بتغير team 

لل

Police

مش شغاله :/

aTeam = createTeam ( "Police" , 100, 149, 237 );

addEvent("JoinPolice",true)
addEventHandler("JoinPolice",root , function ( )
if ( getPlayerTeam ( source ) and getPlayerTeam ( source ) == aTeam ) then return outputChatBox ("* you have this team",source,255,0,0,true) end
setPlayerTeam ( source , aTeam )
setPlayerSkin (source,280)
 giveWeapon ( source, 3, 1 )
 giveWeapon ( source, 23, 200 )
outputChatBox ( 'Now You Are in police job!',source,0,255,0 )
end );
--	 get a table with all teams
local allTeams = getElementsByType ( "Police" )
-- for every team,
for index, theTeam in ipairs(allTeams) do
	-- if friendly fire is off,
	if ( getTeamFriendlyFire ( theTeam ) == false ) then
		-- switch it on
		setTeamFriendlyFire ( theTeam, true )
	end
end

 

Posted
aTeam = createTeam ( "Police" , 100, 149, 237 );

addEvent("JoinPolice",true)
addEventHandler("JoinPolice",root , function ( )
if ( getPlayerTeam ( source ) and getPlayerTeam ( source ) == aTeam ) then return outputChatBox ("* you have this team",source,255,0,0,true) end
setPlayerTeam ( source , aTeam )
setPlayerSkin (source,280)
 giveWeapon ( source, 3, 1 )
 giveWeapon ( source, 23, 200 )
outputChatBox ( 'Now You Are in police job!',source,0,255,0 )
end );

local allTeams = getElementsByType ( "Police" )

for index, theTeam in ipairs(allTeams) do

	if ( getTeamFriendlyFire ( allTeams ) == false ) then

		setTeamFriendlyFire ( allTeams, true )
	end
end

 

Posted
4 minutes ago, mahmod3 said:

aTeam = createTeam ( "Police" , 100, 149, 237 );

addEvent("JoinPolice",true)
addEventHandler("JoinPolice",root , function ( )
if ( getPlayerTeam ( source ) and getPlayerTeam ( source ) == aTeam ) then return outputChatBox ("* you have this team",source,255,0,0,true) end
setPlayerTeam ( source , aTeam )
setPlayerSkin (source,280)
 giveWeapon ( source, 3, 1 )
 giveWeapon ( source, 23, 200 )
outputChatBox ( 'Now You Are in police job!',source,0,255,0 )
end );

local allTeams = getElementsByType ( "Police" )

for index, theTeam in ipairs(allTeams) do

	if ( getTeamFriendlyFire ( allTeams ) == false ) then

		setTeamFriendlyFire ( allTeams, true )
	end
end

 

نفس المشكله :/

Posted

جرب :

 

aTeam = createTeam ( "Police" , 100, 149, 237 )
setTeamFriendlyFire ( aTeam,true )

addEvent("JoinPolice",true)
addEventHandler("JoinPolice",root , 
	function ( )
	 if ( getPlayerTeam ( source ) and getPlayerTeam ( source ) == aTeam ) then 
		 return
		  outputChatBox ("* you have this team",source,255,0,0,true) 
		end
			  setPlayerTeam ( source ,aTeam )
			  setElementModel (source,280)
			  giveWeapon ( source, 3, 1 )
			  giveWeapon ( source, 23, 200 )
			  outputChatBox ( 'Now You Are in police job!',source,0,255,0 )
	end 
)

 

Posted
1 hour ago, Tarek1 said:

السلام عليكم 

 لبعضهم البعض damage من نفس التيم لا يستطيعون ان يعملون Playersشباب ممكن كود يجعل ال 

addEventHandler("onClientPlayerDamage", localPlayer,
function(attacker)
    if (attacker and getElementType(attacker) == "player" and attacker ~= source) then
        local sourceTeam = getPlayerTeam (source)
        local attckerTeam = getPlayerTeam (attacker)
        if(attckerTeam == sourceTeam) then
            cancelEvent()
        end
    end 
end 
)

 

  • Like 3
Posted
13 hours ago, Walid said:

addEventHandler("onClientPlayerDamage", localPlayer,
function(attacker)
    if (attacker and getElementType(attacker) == "player" and attacker ~= source) then
        local sourceTeam = getPlayerTeam (source)
        local attckerTeam = getPlayerTeam (attacker)
        if(attckerTeam == sourceTeam) then
            cancelEvent()
        end
    end 
end 
)

شكرا :)

 

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