Dr.Marco Posted July 27, 2016 Share Posted July 27, 2016 getPlayerTeam x[ مساعدة ]x Team في فانكشن شبااب ابي مساعدة ابي اسوي لما يدخل ماركر يعطيه تيم ولما يدخلو تاني يخرجو من تيم هل هده هي فنكشات لي رح احتاجها getPlayerTeam onMarkerHit بحتاج جداول ولا لا Link to comment
Ahmed Ly Posted July 27, 2016 Share Posted July 27, 2016 "onMarkerHit" setPlayerTeam "onMarkerLeave" Link to comment
xBeSoOo Posted July 27, 2016 Share Posted July 27, 2016 تفضل Event:"onMarkerHit" function () if تتحقق ان الاعب في التيم الي تبيه then setPlayerTeam(thePlayer,nil) else setPlayerTeam(thePlayer,yourteam) end end Link to comment
N3xT Posted July 27, 2016 Share Posted July 27, 2016 تفضل Event:"onMarkerHit" function () if تتحقق ان الاعب في التيم الي تبيه then setPlayerTeam(thePlayer,nil) else setPlayerTeam(thePlayer,yourteam) end end thePlayer مب معرفه Link to comment
xBeSoOo Posted July 27, 2016 Share Posted July 27, 2016 تفضل Event:"onMarkerHit" function () if تتحقق ان الاعب في التيم الي تبيه then setPlayerTeam(thePlayer,nil) else setPlayerTeam(thePlayer,yourteam) end end thePlayer مب معرفه ادري انا اوضحلة بس ذي اسماء افتراضية يعني + ادري ان الاعب بيكون معرف في parameters Link to comment
Ahmed Ly Posted July 27, 2016 Share Posted July 27, 2016 test = createTeam("Test",0,255,0,255) marker1 = createMarker(-675.72711,885.84503,10.49343,"cylinder",1.5,255,255,0,255) addEventHandler("onMarkerHit",marker1, function (player) if getPlayerTeam(player) and getTeamName( getPlayerTeam( player ) ) == "Test" then setPlayerTeam(player,nil) outputChatBox("---",player,0,255,0) else outputChatBox("----",player,0,255,0) setPlayerTeam(player,test) end end ) Link to comment
Mhmd.z Posted July 27, 2016 Share Posted July 27, 2016 local theMarker = createMarker(0, 0, 0, "cylinder", 2, 255, 255, 255, 255) addEventHandler("onMarkerHit", theMarker, function(player) local theTeam = getTeamFromName("theTeam") setPlayerTeam(player, theTeam) end ) addEventHandler("onMarkerLeave", theMarker, function(player) setPlayerTeam(player, nil) end ) Link to comment
N3xT Posted July 27, 2016 Share Posted July 27, 2016 local theMarker = createMarker(0, 0, 0, "cylinder", 2, 255, 255, 255, 255) addEventHandler("onMarkerHit", theMarker, function(player) local theTeam = getTeamFromName("theTeam") setPlayerTeam(player, theTeam) end ) addEventHandler("onMarkerLeave", theMarker, function(player) setPlayerTeam(player, nil) end ) هل تشوف أن الكود حقك صح ؟ Link to comment
Dr.Marco Posted July 27, 2016 Author Share Posted July 27, 2016 كود حق احمد صحيح ولا لا Link to comment
SycroX Posted July 27, 2016 Share Posted July 27, 2016 (edited) local Marker = createMarker(...) -- ... دي يعني معلمومات الماركر المكان و كدا حطها بنفسك Hitted = false addEventHandler("onMarkerHit", resourceRoot, function(hit) if getElementType(hit) == "player" then if source == Marker then if Hitted == false then setPlayerTeam(hit, getTeamFromName("Your Team")) Hitted = true elseif Hitted == true then setPlayerTeam(hit, nil) Hitted = false end end end end) Edited July 27, 2016 by Guest Link to comment
xBeSoOo Posted July 27, 2016 Share Posted July 27, 2016 كود حق احمد صحيحولا لا يب صح بس سوي تحقق من الماركر Link to comment
xBeSoOo Posted July 27, 2016 Share Posted July 27, 2016 local Marker = createMarker(...) -- ... دي يعني معلمومات الماركر المكان و كدا حطها بنفسك Hitted = false addEventHandler("onMarkerHit", resourceRoot, function(hit) if getElementType(hit) == "player" then if source == Marker then if Hitted == false then setPlayerTeam(hit, getTeamFromName("Your Team")) Hitted = true elseif Hitted == true then setPlayerTeam(hit, nil) Hitted = false 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