iMr.Dawix~# Posted June 3, 2013 Share Posted June 3, 2013 (edited) اتوقع يجي كذا بس الي يجيب تيم اللاعب ما يضبط كلنت لازم سيرفر يلا ضبطوه function stopTeamDamage( attacker, weapon, bodypart ) local admins = createTeam ( "Admins", 255, 0, 0 ) local players = createTeam ( "Players", 255, 0, 0 ) if getPlayerTeam(attacker) == admins or getPlayerTeam(attacker) == players and getPlayerTeam(source) == admins or getPlayerTeam(source) == players then cancelEvent() end end addEventHandler ( "onClientPlayerDamage",localPlayer,stopTeamDamage) جرب كذآ ,بس آحسه خرآبيطط , admins = createTeam ( "Admins", 255, 0, 0 ) and createTeam ( "Players", 255, 0, 0 ) addEventHandler ( "onResourceStart", resourceRoot, function() setTeamFriendlyFire(admins,false) end) يخلي اللاعبين الي بالتيم ما يذبحون بعض او يذبحون بعض setTeamFriendlyFire بس صاحب الموضوع يبي تيم ما يقتل تيم افهموا خلاص لا تعيدون Edited June 3, 2013 by Guest Link to comment
فاّرس Posted June 3, 2013 Share Posted June 3, 2013 Event : onPlayerDamage. Functions : getPlayerTeam getTeamFromName cancelEvent سوي اذا تدمج اللاعب يتحقق من التيم اذا ما كان من تيم الادمن مثلا ما يتدمج يعني بستختدم if not ... + سوي فرندلي اذا سويت التيم, createTeam setTeamFriendlyFire الطريقه هذي اسهل لك, + pain @ هو يبي اذا كان من تيم اللاعبين ما يقدر يقتل تيم الادمنيه والعكس, ويبي اذا لاعبين من نفس التيم يقدرون يقتلون بعض Link to comment
PaiN^ Posted June 3, 2013 Share Posted June 3, 2013 ما يتضرر ؟ Players أو Admins يعني تبي لو اللاعب كان في تيم إذا هذا إللي تبيه جرب : -- server admins = createTeam( 'Admins', 255, 0, 0 ); setTeamFriendlyFire( admins, false ); players = createTeam( 'Players', 255, 0, 0 ); setTeamFriendlyFire( players, false ); -- client addEventHandler( 'onClientPlayerDamage', root, function( ) local team = getPlayerTeam( source ); if team then if getTeamName( team ) == 'Admins' or getTeamName( team ) == 'Players' then cancelEvent( ); end end end ); Link to comment
Stranger Posted June 3, 2013 Author Share Posted June 3, 2013 اتوقع يجي كذا بس الي يجيب تيم اللاعب ما يضبط كلنت لازم سيرفريلا ضبطوه function stopTeamDamage( attacker, weapon, bodypart ) local admins = createTeam ( "Admins", 255, 0, 0 ) local players = createTeam ( "Players", 255, 0, 0 ) if getPlayerTeam(attacker) == admins or getPlayerTeam(attacker) == players and getPlayerTeam(source) == admins or getPlayerTeam(source) == players then cancelEvent() end end addEventHandler ( "onClientPlayerDamage",localPlayer,stopTeamDamage) جرب كذآ ,بس آحسه خرآبيطط , admins = createTeam ( "Admins", 255, 0, 0 ) and createTeam ( "Players", 255, 0, 0 ) addEventHandler ( "onResourceStart", resourceRoot, function() setTeamFriendlyFire(admins,false) end) يخلي اللاعبين الي بالتيم ما يذبحون بعض او يذبحون بعض setTeamFriendlyFire بس صاحب الموضوع يبي تيم ما يقتل تيم افهموا خلاص لا تعيدون حطيته كلينت ماضبط Link to comment
فاّرس Posted June 3, 2013 Share Posted June 3, 2013 admins = createTeam( 'Admins', 255, 0, 0 ); players = createTeam( 'Players', 255, 0, 0 ); addEventHandler( 'onPlayerDamage',root, function( ) local team = getPlayerTeam( source ); if team then if not getTeamName( team ) == 'admins' then cancelEvent(); if not getTeamName( team ) == 'players' then cancelEvent(); end end end end ); Link to comment
Stranger Posted June 3, 2013 Author Share Posted June 3, 2013 ما يتضرر ؟ Players أو Admins يعني تبي لو اللاعب كان في تيم إذا هذا إللي تبيه جرب : -- server admins = createTeam( 'Admins', 255, 0, 0 ); setTeamFriendlyFire( admins, false ); players = createTeam( 'Players', 255, 0, 0 ); setTeamFriendlyFire( players, false ); -- client addEventHandler( 'onClientPlayerDamage', root, function( ) local team = getPlayerTeam( source ); if team then if getTeamName( team ) == 'Admins' or getTeamName( team ) == 'Players' then cancelEvent( ); end end end ); تسلم والله Link to comment
فاّرس Posted June 3, 2013 Share Posted June 3, 2013 ما يتضرر ؟ Players أو Admins يعني تبي لو اللاعب كان في تيم إذا هذا إللي تبيه جرب : -- server admins = createTeam( 'Admins', 255, 0, 0 ); setTeamFriendlyFire( admins, false ); players = createTeam( 'Players', 255, 0, 0 ); setTeamFriendlyFire( players, false ); -- client addEventHandler( 'onClientPlayerDamage', root, function( ) local team = getPlayerTeam( source ); if team then if getTeamName( team ) == 'Admins' or getTeamName( team ) == 'Players' then cancelEvent( ); end end end ); كذا الي في تيم الادمن ما يقدر يقتل خويه ولي في تيم اللاعبين ما يقدرون يقتلون بعض, هو يبي الكود يقدر يقتل الي معه بالتيم بس الي مو معه ما يقدر Link to comment
PaiN^ Posted June 3, 2013 Share Posted June 3, 2013 ما يتضرر ؟ Players أو Admins يعني تبي لو اللاعب كان في تيم إذا هذا إللي تبيه جرب : -- server admins = createTeam( 'Admins', 255, 0, 0 ); setTeamFriendlyFire( admins, false ); players = createTeam( 'Players', 255, 0, 0 ); setTeamFriendlyFire( players, false ); -- client addEventHandler( 'onClientPlayerDamage', root, function( ) local team = getPlayerTeam( source ); if team then if getTeamName( team ) == 'Admins' or getTeamName( team ) == 'Players' then cancelEvent( ); end end end ); تسلم والله حياك الله ,, @ The Best : ما فهمت عليك + كودك فيه أغلاط Link to comment
فاّرس Posted June 3, 2013 Share Posted June 3, 2013 اقصد هو يبي اذا كان اللاعب في تيم الادمن ما يقدر يقتل التيم الثاني والعكس, واذا كان اللاعب في تيم الادمن يقدر يقتل خويه والعكس, + وين الاغلاط نستفيد ذذ, اتوقع تقصد بالتحقق ؟ if getPlayerTeam... ? Link to comment
PaiN^ Posted June 3, 2013 Share Posted June 3, 2013 onPlayerDamage > ما تقدر تلغيه + يب حق الإف ذذ + -- server admins = createTeam( 'Admins', 255, 0, 0 ); setTeamFriendlyFire( admins, false ); players = createTeam( 'Players', 255, 0, 0 ); setTeamFriendlyFire( players, false ); -- client addEventHandler( 'onClientPlayerDamage', root, function( a ) if a and a ~= localPlayer then local team_s = getPlayerTeam( source ); local team_a = getPlayerTeam( a ); if team_s and team_a then if getTeamName( team_a ) == 'Admins' and getTeamName( team_s ) == 'Players' or getTeamName( team_s ) == 'Admins' and getTeamName( team_a ) == 'Players'then cancelEvent( ); end 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