Tarek1 Posted September 13, 2017 Share Posted September 13, 2017 (edited) --Server side -- و اذا كان الاعب في عربيه في ديمنشن 1 و خرج من العربيه يكون بنفس الديمنشن function onPlayerExitVehicle ( theVehicle, seat, jacker ) if ( getElementDimension ( source ) == 1 and seat == 1 ) then setElementDimension ( source, 1 ) setElementDimension ( theVehicle, 1 ) end end addEventHandler ( "onPlayerVehicleExit", root, onPlayerExitVehicle ) -- -- اذا كان الاعب في ديمنشن 1 و مات ينزل في نفس الديمنشن addEventHandler( "onPlayerWasted", getRootElement( ),function() if ( getElementDimension ( source ) == 1 then setElementDimension (source,1) end end end ) -- اذا كتب الاعب هذه الكومند يكون في ديمنشن صفر addCommandHandler("leave",function() setElementDimension( source,0) end ) -- اذا كان تيم الشخص ميدك لا يتسطيع ان يقتل الاعبون addEventHandler ( "onPlayerDamage", getRootElement (),function() if ( attacker ) and ( attacker ~= source ) and ( getPlayerTeam(attacker) ) and ( getTeamName(getPlayerTeam(attacker)) == "Medic" ) then cancelEvent() end end ) -- مساعده هل يمكن جعل تيم ال Police لا يتسطيع ان يقتل تيم اخر ؟؟ Edited September 13, 2017 by Tarek1 Link to comment
Rakan# Posted September 14, 2017 Share Posted September 14, 2017 اكوادك الاخيره خطا جرب ذا وشوف -- اذا كتب الاعب هذه الكومند يكون في ديمنشن صفر addCommandHandler("leave",function(player) setElementDimension(player,0) end ) -- اذا كان تيم الشخص ميدك لا يتسطيع ان يقتل الاعبون addEventHandler("onPlayerDamage", root, function(_,attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Medic" then cancelEvent() end end) addEventHandler("onPlayerDamage", root, function(_,attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Police" then cancelEvent() end end) إذا ما اشتغل كلمني اخوي . إستبدل الاكواد ^ باخر 2 Link to comment
Tarek1 Posted September 14, 2017 Author Share Posted September 14, 2017 (edited) 17 minutes ago, Rakan# said: اكوادك الاخيره خطا جرب ذا وشوف -- اذا كتب الاعب هذه الكومند يكون في ديمنشن صفر addCommandHandler("leave",function(player) setElementDimension(player,0) end ) -- اذا كان تيم الشخص ميدك لا يتسطيع ان يقتل الاعبون addEventHandler("onPlayerDamage", root, function(_,attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Medic" then cancelEvent() end end) addEventHandler("onPlayerDamage", root, function(_,attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Police" then cancelEvent() end end) إذا ما اشتغل كلمني اخوي . إستبدل الاكواد ^ باخر 2 لاكواد لا تعمل Edited September 14, 2017 by Tarek1 Link to comment
Rakan# Posted September 14, 2017 Share Posted September 14, 2017 عذرا ..! استبدلها تسذي -- اذا كتب الاعب هذه الكومند يكون في ديمنشن صفر addCommandHandler("leave",function(player) setElementDimension(player,0) end ) -- اذا كان تيم الشخص ميدك لا يتسطيع ان يقتل الاعبون addEventHandler("onPlayerDamage", root, function(attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Medic" then cancelEvent() end end) addEventHandler("onPlayerDamage", root, function(attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Police" then cancelEvent() end end) 1 Link to comment
' A F . Posted September 14, 2017 Share Posted September 14, 2017 @Rakan# 'onPlayerDamage' مأيتكنسل إستخدم 'onClientPlayerDamage' 2 Link to comment
Rakan# Posted September 14, 2017 Share Posted September 14, 2017 42 minutes ago, Default#^ said: @Rakan# 'onPlayerDamage' مأيتكنسل إستخدم 'onClientPlayerDamage' آها معليش , شكرا ع المعلومه م دريت يعطيك العافيه 1 Link to comment
mohamed hussein Posted September 14, 2017 Share Posted September 14, 2017 السلام عليكم اخي اكوادك فيها اخطاء و هيا اولا انت مسوي لو اللاعب في دايمنشن 1 ومات لازم تعملو spawn لانو ما ينفع تغير الدامينشن و اللاعب ميت فالكود لازم يكون كذا function respawn () local x, y, z = getElementPosition ( source ) --هنا علشان ينزلو في نفس مكان القتل local dim = getElementDimension ( source ) --علشان ينززل في نفس الدايمنشن اللي كان فيه local skin = getPlayerSkin ( source ) --علشان يكون لابس نفس اللبس local int = getElementInterior ( source ) --علشان لو كان جوا انتريور ينزل في نفس الانتريور local team = getPlayerTeam ( source ) --علشان ينزل في نفس التيم spawnPlayer (source, x, y, z, 0, skin, int, dim, team) --ديه فنكشن الاحياء اصلا end addEventHandler ( "onPlayerWasted", root, respawn) بالنسبة للكومان مينفعش تكون كل حاجة سورس زي ما انت ما عامل الكوماند تكون كذا function dim0 ( thePlayer, commandName) setElementDimension ( thePlayer, 0) end addCommandHandler ("leave", dim0) اما بالنسبة للميديكك لازم تستخدم كليننت لانو السيرفر ايفينت ديه ملهاش كانسل -- client side function canceldamage ( attacker ) if ( attacker) and ( attacker ~= source ) and ( getTeamName ( getPlayerTeam ( attacker )) == "Medic" ) then cancelEvent ( ) end end addEventHandler ( "onClientPlayerDamage", root, canceldamage) بالنسبة لأخر سؤال اه تستطيع زي بتاع الميديك بس هتضيف شرط -- client side function canceldamagepolice ( attacker ) if ( attacker) and ( attacker ~= source ) and ( getTeamName ( getPlayerTeam ( attacker )) == "police" ) then if ( getTeamName ( getPlayerTeam ( source )) == "اسم التيم التاني " ) then cancelEvent ( ) end end end addEventHandler ( "onClientPlayerDamage", root, canceldamagepolice) 1 Link to comment
Tarek1 Posted September 14, 2017 Author Share Posted September 14, 2017 1 hour ago, mohamed hussein said: السلام عليكم اخي اكوادك فيها اخطاء و هيا اولا انت مسوي لو اللاعب في دايمنشن 1 ومات لازم تعملو spawn لانو ما ينفع تغير الدامينشن و اللاعب ميت فالكود لازم يكون كذا function respawn () local x, y, z = getElementPosition ( source ) --هنا علشان ينزلو في نفس مكان القتل local dim = getElementDimension ( source ) --علشان ينززل في نفس الدايمنشن اللي كان فيه local skin = getPlayerSkin ( source ) --علشان يكون لابس نفس اللبس local int = getElementInterior ( source ) --علشان لو كان جوا انتريور ينزل في نفس الانتريور local team = getPlayerTeam ( source ) --علشان ينزل في نفس التيم spawnPlayer (source, x, y, z, 0, skin, int, dim, team) --ديه فنكشن الاحياء اصلا end addEventHandler ( "onPlayerWasted", root, respawn) بالنسبة للكومان مينفعش تكون كل حاجة سورس زي ما انت ما عامل الكوماند تكون كذا function dim0 ( thePlayer, commandName) setElementDimension ( thePlayer, 0) end addCommandHandler ("leave", dim0) اما بالنسبة للميديكك لازم تستخدم كليننت لانو السيرفر ايفينت ديه ملهاش كانسل -- client side function canceldamage ( attacker ) if ( attacker) and ( attacker ~= source ) and ( getTeamName ( getPlayerTeam ( attacker )) == "Medic" ) then cancelEvent ( ) end end addEventHandler ( "onClientPlayerDamage", root, canceldamage) بالنسبة لأخر سؤال اه تستطيع زي بتاع الميديك بس هتضيف شرط -- client side function canceldamagepolice ( attacker ) if ( attacker) and ( attacker ~= source ) and ( getTeamName ( getPlayerTeam ( attacker )) == "police" ) then if ( getTeamName ( getPlayerTeam ( source )) == "اسم التيم التاني " ) then cancelEvent ( ) end end end addEventHandler ( "onClientPlayerDamage", root, canceldamagepolice) شكرا ? 11 hours ago, Rakan# said: عذرا ..! استبدلها تسذي -- اذا كتب الاعب هذه الكومند يكون في ديمنشن صفر addCommandHandler("leave",function(player) setElementDimension(player,0) end ) -- اذا كان تيم الشخص ميدك لا يتسطيع ان يقتل الاعبون addEventHandler("onPlayerDamage", root, function(attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Medic" then cancelEvent() end end) addEventHandler("onPlayerDamage", root, function(attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Police" then cancelEvent() end end) شكرا ? Link to comment
Rakan# Posted September 14, 2017 Share Posted September 14, 2017 العفو حياك , هل ضبط معك ؟ 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