Ahmed Eka Posted September 20, 2016 Share Posted September 20, 2016 addCommandHandler ( "nuke", function ( thePlayer ) local x,y,z = getElementPosition(thePlayer) local marker = createMarker ( x , y , z, "cylinder", 15, 255, 255, 0, 170 ) if marker and getElementType(marker) == "marker" then if isElementWithinMarker(thePlayer, marker) then for _,p in ipairs(getElementsByType("player")) do if ( p ~= thePlayer ) then killPed (p) end end end end end ) شباب الحين انا مسوي لما يكتب كلمه باف 8 يسوي ماركر و كل يلي في الماركر يموت .. الحين ما يموت اللاعب .. انا عندي استفسار الحين انا ابيه يموت اللاعب مدري ليش وين الخطا .. كمان الحين انا عندي استفسار .. الحين لو لاعب جاء دخل الماركر ما راح يقتلو صح ؟ Link to comment
Mhmd.z Posted September 20, 2016 Share Posted September 20, 2016 كيف تبي الاعب يموت وانت حاط ذا التحقق if ( p ~= thePlayer ) then Link to comment
MR.Mosa Posted September 20, 2016 Share Posted September 20, 2016 اتوقع لازم كذا addCommandHandler ( "nuke", function ( thePlayer ) local x,y,z = getElementPosition(thePlayer) local marker = createMarker ( x , y , z, "cylinder", 15, 255, 255, 0, 170 ) if marker and getElementType(marker) == "marker" then if isElementWithinMarker(thePlayer, marker) then for _,p in ipairs(getElementsByType("player")) do if ( p ~= thePlayer ) then killPlayer(p) end end end end end ) Link to comment
Abdul KariM Posted September 20, 2016 Share Posted September 20, 2016 1 minute ago, MR.Mosa said: اتوقع لازم كذا addCommandHandler ( "nuke", function ( thePlayer ) local x,y,z = getElementPosition(thePlayer) local marker = createMarker ( x , y , z, "cylinder", 15, 255, 255, 0, 170 ) if marker and getElementType(marker) == "marker" then if isElementWithinMarker(thePlayer, marker) then for _,p in ipairs(getElementsByType("player")) do if ( p ~= thePlayer ) then killPlayer(p) end end end end end ) This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. Please use killPed instead. + سطر 5 ماله داعي 1 Link to comment
!#NssoR_) Posted September 20, 2016 Share Posted September 20, 2016 الكود طويل ع الفاضي , وش بتسوي بالضبط انت ؟ Link to comment
Ahmed Eka Posted September 20, 2016 Author Share Posted September 20, 2016 17 hours ago, NssoR said: الكود طويل ع الفاضي , وش بتسوي بالضبط انت ؟ لما لاعب يكتب كلمه باف 8 .. يجي ماركر و اي شخص يكون بداخله يموت و اي شخص يدخل فيه يموت .. Link to comment
' A F . Posted September 21, 2016 Share Posted September 21, 2016 ماجربته .. local Markers = { }; addCommandHandler ( "nuke" , function ( player ) if ( isElement ( Markers [ player ] ) ) then destroyElement ( Markers [ player ] ) end local Pos = { getElementPosition ( player ) }; Markers [ player ] = createMarker (Pos[1],Pos[2],Pos[3]-1,"cylinder",255,255,0,255) for index,values in ipairs ( getElementsByType ( "player" ) ) do if ( isElementWithinMarker ( values , Markers [ player ] ) ) then killPed ( values ) end end end ); addEventHandler ( "onPlayerQuit" , root , function ( ) if ( isElement ( Markers [ source ] ) ) then destroyElement ( Markers [ source ] ) Markers [ source ] = nil end end ); Link to comment
iPrestege Posted September 21, 2016 Share Posted September 21, 2016 (edited) local marker = { } addCommandHandler ( "nuke", function ( player ) if ( isElement ( marker [ player ] ) ) then destroyElement ( marker [ player ] ) end local x,y,z = getElementPosition ( player ) marker [ player ] = createMarker ( x,y,z,"cylinder",15, 255, 255, 0, 170 ) addEventHandler ( "onMarkerHit",marker [ player ], function ( hitElement ) if getElementType ( hitElement ) == "player" and hitElement ~= player then killPed ( hitElement ) end end ) setTimer ( function ( ) for _,thePlayer in ipairs ( getElementsByType ( "player" ) ) do if isElementWithinMarker ( thePlayer,marker [ player ] ) then if ( thePlayer == player ) then return false end killPed ( thePlayer ) end end end,3000,1 ) end ) addEventHandler ( "onPlayerQuit",root, function ( ) if ( isElement ( marker [ source ] ) ) then destroyElement ( marker [ source ] ) marker [ source ] = nil end end ) Edited September 21, 2016 by Mr.Pres[T]ege Link to comment
!#NssoR_) Posted September 21, 2016 Share Posted September 21, 2016 (edited) @Mr.Pres[T]ege برستيج شكله النوم لاعب فيك لعب الكود الصحيح بهذا الشكل : local marker = { } addCommandHandler ( "nuke", function ( player ) if ( isElement ( marker [ player ] ) ) then destroyElement ( marker [ player ] ) end local x,y,z = getElementPosition ( player ) marker [ player ] = createMarker ( x,y,z,"cylinder",15, 255, 255, 0, 170 ) addEventHandler ( "onMarkerHit",marker [ player ], function ( hitElement ) if getElementType ( hitElement ) == "player" then killPed ( hitElement ) end end) for _,thePlayer in ipairs ( getElementsByType ( "player" ) ) do if isElementWithinMarker ( thePlayer,marker [ player ] ) then killPed ( thePlayer ) end end end ) addEventHandler ( "onPlayerQuit",root, function ( ) if ( isElement ( marker [ source ] ) ) then destroyElement ( marker [ source ] ) marker [ source ] = nil end end ) Edited September 21, 2016 by NssoR 1 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