Tarek1 Posted October 10, 2016 Share Posted October 10, 2016 السلام عليكم لبعضهم البعض damage من نفس التيم لا يستطيعون ان يعملون Playersشباب ممكن كود يجعل ال Link to comment
Tarek1 Posted October 10, 2016 Author Share Posted October 10, 2016 12 minutes ago, Ahmed Ly said: setTeamFriendlyFire ممكن مثال يعني تكون لتيم البوليس ? Link to comment
mahmod3 Posted October 10, 2016 Share Posted October 10, 2016 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 Link to comment
Tarek1 Posted October 10, 2016 Author Share Posted October 10, 2016 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"انا جربتها بس مش عارف اعمل لل Link to comment
mahmod3 Posted October 10, 2016 Share Posted October 10, 2016 Just now, Tarek1 said: "Police"انا جربتها بس مش عارف اعمل لل بتغير team لل Police Link to comment
Tarek1 Posted October 10, 2016 Author Share Posted October 10, 2016 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 Link to comment
mahmod3 Posted October 10, 2016 Share Posted October 10, 2016 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 Link to comment
Tarek1 Posted October 10, 2016 Author Share Posted October 10, 2016 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 نفس المشكله Link to comment
iPrestege Posted October 11, 2016 Share Posted October 11, 2016 جرب : 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 ) Link to comment
Walid Posted October 11, 2016 Share Posted October 11, 2016 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 ) 3 Link to comment
Tarek1 Posted October 11, 2016 Author Share Posted October 11, 2016 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 ) شكرا Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now