~>i'Mr.ZaId<~ Posted June 4, 2013 Share Posted June 4, 2013 السلام عليكم يا شباب هاذ الكود صح؟ يعني فريق معين الي هو سوات مثلا اذا لمس الماركر يجيه دم ودرع واذا ناس مو من فريق سوات ما يجيه دم ودرع بس الكود خطا صححوه لي لاهنتم marker = createMarker(1925,484,61,"cylinder",2,255,0,255,255) function state (thePlayer) if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then setPedStat(thePlayer,24,989) setElementHealth ( thePlayer, 200 ) setPedArmor ( thePlayer, 100 ) setPedSkin ( thePlayer, 115 ) end end addEventHandler("onMarkerHit",marker,state) Link to comment
فاّرس Posted June 4, 2013 Share Posted June 4, 2013 (edited) marker = createMarker(1925,484,61,"cylinder",2,255,0,255,255) addEventHandler("onMarkerHit",marker, function (player) if (getElementType(player) == 'player' ) then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then setPedStat(player,24,989) setElementHealth ( player, 200 ) setPedArmor ( player, 100 ) setPedSkin ( player, 115 ) else outputChatBox("* You most be 'SWAT'",player,0,0,255,true) end end end) Edited June 4, 2013 by Guest Link to comment
iPrestege Posted June 4, 2013 Share Posted June 4, 2013 المفروض تتحقق من اللي لمس الماركر لو صار سيارة وش تتوقع يصير؟ Link to comment
iMr.Dawix~# Posted June 4, 2013 Share Posted June 4, 2013 (edited) marker = createMarker(1925,484,61,"cylinder",2,255,0,255,255) function state (thePlayer) if getElementType(thePlayer) == "player" then if getPlayerTeam (thePlayer) == getTeamFromName( "SWAT" ) then setPedStat(thePlayer,24,989) setElementHealth ( thePlayer, 200 ) setPedArmor ( thePlayer, 100 ) setPedSkin ( thePlayer, 115 ) else outputChatBox("* You most be in 'SWAT' team !",thePlayer,153,0,0,true) end end end addEventHandler("onMarkerHit",marker,state) Edited June 4, 2013 by Guest Link to comment
AHMAD1234 Posted June 4, 2013 Share Posted June 4, 2013 المفروض تتحقق من اللي لمس الماركر لو صار سيارة وش تتوقع يصير؟ +1 if isPedInVehicle ( player ) then return end Link to comment
فاّرس Posted June 4, 2013 Share Posted June 4, 2013 المفروض تتحقق من اللي لمس الماركر لو صار سيارة وش تتوقع يصير؟ مم ما احب ازود على اكواد الناس, هو عطاني كود محدد اعطيه الكود مصحح بدون زيادات, وشكرآ للتنبيه, المفروض تتحقق من اللي لمس الماركر لو صار سيارة وش تتوقع يصير؟ +1 if isPedInVehicle ( player ) then return end Link to comment
~>i'Mr.ZaId<~ Posted June 4, 2013 Author Share Posted June 4, 2013 المفروض تتحقق من اللي لمس الماركر لو صار سيارة وش تتوقع يصير؟ بس تتفجر وتصير اجزاء ههه انا حاط الكود فوق لاهنت صححه وحط التحقق من اللالمنت لاني انا ماعندي خبرة كثيرة بالبرمجة بس بسيطة وشكرا Link to comment
فاّرس Posted June 4, 2013 Share Posted June 4, 2013 المفروض تتحقق من اللي لمس الماركر لو صار سيارة وش تتوقع يصير؟ بس تتفجر وتصير اجزاء ههه انا حاط الكود فوق لاهنت صححه وحط التحقق من اللالمنت لاني انا ماعندي خبرة كثيرة بالبرمجة بس بسيطة وشكرا marker = createMarker(1925,484,61,"cylinder",2,255,0,255,255) addEventHandler("onMarkerHit",marker, function (player) if (getElementType(player) == 'player' ) then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then setPedStat(player,24,989) setElementHealth ( player, 200 ) setPedArmor ( player, 100 ) setPedSkin ( player, 115 ) else outputChatBox("* You most be 'SWAT'",player,0,0,255,true) end end end) Link to comment
3NAD Posted June 4, 2013 Share Posted June 4, 2013 marker = createMarker(1925,484,61,"cylinder",2,255,0,255,255) addEventHandler("onMarkerHit",marker, function (player) if (getElementType(player) == 'player' ) then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then setPedStat(player,24,989) setElementHealth ( player, 200 ) setPedArmor ( player, 100 ) setPedSkin ( player, 115 ) else outputChatBox("* You most be 'SWAT'",player,0,0,255,true) end end end) ممكن يسبب أخطاء لو اللاعب ماكان في تيم marker = createMarker ( 1925, 484, 61, "cylinder", 2, 255, 0, 255, 255 ) addEventHandler ( "onMarkerHit", marker, function ( player ) if getElementType ( player ) == "player" then local playerTeam = getPlayerTeam ( player ) if playerTeam then if playerTeam == getTeamFromName ( "SWAT" ) then setPedStat ( player, 24, 989 ) setElementHealth ( player, 200 ) setPedArmor ( player, 100 ) setPedSkin ( player, 115 ) else outputChatBox ( "* You most be 'SWAT'", player, 0, 0, 255, true ) end end end end , false ) Link to comment
~>i'Mr.ZaId<~ Posted June 4, 2013 Author Share Posted June 4, 2013 شككرا يا شباب وربي انكم كفوو بس عندي طلب ثاني واسف على الازعآج والطلب هو رسباون لفريق معين يعني لو مات يرجع لمكان سباونه وشكرا Link to comment
iPrestege Posted June 4, 2013 Share Posted June 4, 2013 This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. Please use setElementModel instead. Link to comment
3NAD Posted June 4, 2013 Share Posted June 4, 2013 شككرا يا شباب وربي انكم كفوو بس عندي طلب ثاني واسف على الازعآج والطلب هو رسباون لفريق معين يعني لو مات يرجع لمكان سباونه وشكرا getPlayerTeam -- جلب تيم اللاعب spawnPlayer -- سباون "onPlayerWasted" -- يوم يموت Ex.: if getPlayerTeam ( ) == "xd" then spawnPlayer ( ....... ) else -- إذا ماتحقق الشرط spawnPlayer ( ....... ) end Link to comment
iMr.Dawix~# Posted June 4, 2013 Share Posted June 4, 2013 شككرا يا شباب وربي انكم كفوو بس عندي طلب ثاني واسف على الازعآج والطلب هو رسباون لفريق معين يعني لو مات يرجع لمكان سباونه وشكرا getPlayerTeam -- جلب تيم اللاعب spawnPlayer -- سباون "onPlayerWasted" -- يوم يموت Ex.: if getPlayerTeam ( ) == "xd" then spawnPlayer ( ....... ) else -- إذا ماتحقق الشرط spawnPlayer ( ....... ) end اذا كان التيم مو من هذا المود تستخدم getTeamFromName Link to comment
~>i'Mr.ZaId<~ Posted June 4, 2013 Author Share Posted June 4, 2013 صح الكود يا عـيآل؟ يقلي خطآ function spawn () if getPlayerTeam () == "SWAT" then spawnPlayer ( 1859,552,321 ) else -- إذا ماتحقق الشرط spawnPlayer ( 1835,551,321 ) end end ) addEventHandler("onPlayerSpawn",spawn) Link to comment
فاّرس Posted June 4, 2013 Share Posted June 4, 2013 function spawn (player) if getPlayerTeam (player) == "SWAT" then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end addEventHandler("onPlayerSpawn",root,spawn) حبيت اوضح لك انه يسوي سباون اول ما اللاعب يسوي سباون يعني بعد ما يدخل تقريبا Link to comment
~>i'Mr.ZaId<~ Posted June 4, 2013 Author Share Posted June 4, 2013 صح الكود؟ function spawn () if getPlayerTeam () == "SWAT" then spawnPlayer ( 1859,552,321 ) else -- إذا ماتحقق الشرط spawnPlayer ( 1835,551,321 ) end end ) addEventHandler("onPlayerSpawn",spawn) Link to comment
فاّرس Posted June 4, 2013 Share Posted June 4, 2013 صح الكود؟ function spawn () if getPlayerTeam () == "SWAT" then spawnPlayer ( 1859,552,321 ) else -- إذا ماتحقق الشرط spawnPlayer ( 1835,551,321 ) end end ) addEventHandler("onPlayerSpawn",spawn) لا شوف انا وش سويت function spawn (player) if getPlayerTeam (player) == "SWAT" then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end addEventHandler("onPlayerSpawn",root,spawn) حبيت اوضح لك انه يسوي سباون اول ما اللاعب يسوي سباون يعني بعد ما يدخل تقريبا ولكن الافضل تسويه كذآ, function spawn (player) if getElementType(player) == 'player' then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end end addEventHandler("onPlayerSpawn",root,spawn) Link to comment
~>i'Mr.ZaId<~ Posted June 4, 2013 Author Share Posted June 4, 2013 يآ خوي الكود ماآ نــفع فيه خطآ يمكن صح الكود؟ function spawn () if getPlayerTeam () == "SWAT" then spawnPlayer ( 1859,552,321 ) else -- إذا ماتحقق الشرط spawnPlayer ( 1835,551,321 ) end end ) addEventHandler("onPlayerSpawn",spawn) لا شوف انا وش سويت function spawn (player) if getPlayerTeam (player) == "SWAT" then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end addEventHandler("onPlayerSpawn",root,spawn) حبيت اوضح لك انه يسوي سباون اول ما اللاعب يسوي سباون يعني بعد ما يدخل تقريبا ولكن الافضل تسويه كذآ, function spawn (player) if getElementType(player) == 'player' then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end end addEventHandler("onPlayerSpawn",root,spawn) Link to comment
#Al-Ha[J]aRii Posted June 4, 2013 Share Posted June 4, 2013 يآ خوي الكود ماآ نــفع فيه خطآ يمكن صح الكود؟ function spawn () if getPlayerTeam () == "SWAT" then spawnPlayer ( 1859,552,321 ) else -- إذا ماتحقق الشرط spawnPlayer ( 1835,551,321 ) end end ) addEventHandler("onPlayerSpawn",spawn) لا شوف انا وش سويت function spawn (player) if getPlayerTeam (player) == "SWAT" then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end addEventHandler("onPlayerSpawn",root,spawn) حبيت اوضح لك انه يسوي سباون اول ما اللاعب يسوي سباون يعني بعد ما يدخل تقريبا ولكن الافضل تسويه كذآ, function spawn (player) if getElementType(player) == 'player' then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end end addEventHandler("onPlayerSpawn",root,spawn) الكود صحيح ! تأكد خليته سيرفر Link to comment
AboFaisal Posted June 4, 2013 Share Posted June 4, 2013 ممكن انسخ الكود احتاجه لاهنت ؟؟ محترم ماشاء الله Link to comment
~>i'Mr.ZaId<~ Posted June 4, 2013 Author Share Posted June 4, 2013 يب تآكدت سـيرفر يآ خوي الكود ماآ نــفع فيه خطآ يمكن لا شوف انا وش سويت function spawn (player) if getPlayerTeam (player) == "SWAT" then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end addEventHandler("onPlayerSpawn",root,spawn) حبيت اوضح لك انه يسوي سباون اول ما اللاعب يسوي سباون يعني بعد ما يدخل تقريبا ولكن الافضل تسويه كذآ, function spawn (player) if getElementType(player) == 'player' then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end end addEventHandler("onPlayerSpawn",root,spawn) Link to comment
iMr.Dawix~# Posted June 4, 2013 Share Posted June 4, 2013 function spawn(player) if getElementType(player) == "player" then if getPlayerTeam (player) == getTeamFromName("SWAT") then spawnPlayer(player,x,y,z) end end end addEventHandler("onPlayerJoin",root,spawn) Link to comment
3NAD Posted June 4, 2013 Share Posted June 4, 2013 صح الكود؟ function spawn () if getPlayerTeam () == "SWAT" then spawnPlayer ( 1859,552,321 ) else -- إذا ماتحقق الشرط spawnPlayer ( 1835,551,321 ) end end ) addEventHandler("onPlayerSpawn",spawn) انت ماتقرا صفحات الاكواد صح ؟؟ عندك خطأ هنا getPlayerTeam ( الإلمنت اللي راح تجلب منه التيم ) و بالكود ذا ماحددت الإلمنت اللي راح يسوي السباون spawnPlayer و بـ الإيفنت ماأضفت أرقومنت الإلمنت اللي راح ينربط فيه الإيفنت addEventHandler ( "onPlayerSpawn", getRootElement ( ), spawn ) وتقدر تعرف الإلمنت من هالصفحة https://wiki.multitheftauto.com/wiki/Element لو تلاحظ انه يكون لاعب او شخصية او حتى نافذة Link to comment
فاّرس Posted June 4, 2013 Share Posted June 4, 2013 اعتقد والله اعلم , إن هذا الكود شغال , function spawn (player) if getElementType(player) == 'player' then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end end addEventHandler("onPlayerSpawn",root,spawn) بس يمكن انت متلخبط بالاحداث , Link to comment
3NAD Posted June 4, 2013 Share Posted June 4, 2013 اعتقد والله اعلم , إن هذا الكود شغال , function spawn (player) if getElementType(player) == 'player' then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end end addEventHandler("onPlayerSpawn",root,spawn) بس يمكن انت متلخبط بالاحداث , إفرض اني بدون تيم و صار لي سباون رآح ينفذ الإحداثيات الأولى .. فـ الأفضل انك تثبت وجود تيم اللاعب في شرط و ثم تحقق شرط ان يكوت سوات هو تيم اللاعب 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