~>i'Mr.ZaId<~ Posted August 1, 2013 Share Posted August 1, 2013 السلام عليكم ورحمة الله وبركاته ياشباب بغيت مساعدتكم بكود بس هو ما ظبط عندي هو يعني اذا لمس الماركر يروح لاربع اماكن عشوائية اناحطيتهم بجدول بس لما اروح على الماركر ما يصير شي يعني خطا وذا الكود local groupName = '[saW]' tawa1 = createMarker(840,1312,36,"cylinder",2,0,0,0,255) postion = { {847,1422,56}, {855,1244,56}, {958,1257,56}, {951,1424,56} } addEventHandler("onMarkerHit",tawa1, function ( hPlayer ) if getElementData( hPlayer, 'Group' ) == groupName and getPlayerTeam( hPlayer ) and getTeamName( getPlayerTeam( hPlayer ) ) == 'No Team' then local x,y,z = unpack(postion[math.random(#postion)]) setElementPosition( source, x,y,z ) end end ) Link to comment
فاّرس Posted August 1, 2013 Share Posted August 1, 2013 اظن الجدول شغال ذذ لكن اذا ما اشتغل غيره ذذ, postion = { [1] = {847,1422,56}, [2] = {855,1244,56}, [3] = {958,1257,56}, [4] = {951,1424,56} } المهم سوي تحقق للاعب , if getElementType(hPlayer) == 'player' then + source = ينقل الماركر خليه hPlayer عشان ينقل اللاعب ذذ Link to comment
3NAD Posted August 1, 2013 Share Posted August 1, 2013 لم يتم التجربة local groupName = '[saW]' tawa1 = createMarker(840,1312,36,"cylinder",2,0,0,0,255) postion = { {847,1422,56}, {855,1244,56}, {958,1257,56}, {951,1424,56}, } addEventHandler ( "onMarkerHit", tawa1, function ( hPlayer ) if getElementType ( hPlayer ) then local plrTeam = getPlayerTeam ( hPlayer ) if plrTeam then if getElementData ( hPlayer, "Group" ) == groupName and getTeamName ( plrTeam ) == "No Team" then local randomPosition = postion[math.random(#postion)] local x, y, z = randomPosition[1], randomPosition[2], randomPosition[3] setElementPosition ( hPlayer, x, y, z ) 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