[KilleR] Posted July 9, 2016 Posted July 9, 2016 السلام عليكم انا سويت لوحه فيها قريد ليست بحط فيه اللاعبين - 1 فيها اثنين بوتون واحد اعطاء الصلاحيه والثاني سحب الصلاحيه -2 اذا ضغط على اللاعب وسوا اعطاء صلاحيه وكتب باف 8 حارس يجيه حارس واذا كتبه ثانيه يختفي انا لقيت كود الاخ سو كنق لاكن مايلحقني يدرعم لحاله addCommandHandler("createPed_", function ( ) local Position = { getElementPosition(localPlayer) } setPedControlState( createPed(0, Position[1] + 1, Position[2], Position[3] ) ,"forwards", true) end ) ونفس ماقلتكم والي يكتبها حارس ومامعه صلاحيه يقوله لاتملك الصلاحيه هاتو الرابط ويا الشرح
' A F . Posted July 9, 2016 Posted July 9, 2016 عشان يلحقك استخدم هاذا الفنكشن findRotation getElementRotation setElementRotation
[KilleR] Posted July 9, 2016 Author Posted July 9, 2016 function pedRotate ( ) local rotX, rotY, rotZ = getElementRotation(localPlayer) setElementRotation(localPlayer,0,0,rotZ+10,"default",true) end addCommandHandler ( "turn", pedRotate ) جذي؟ عاد الباقيات مافهمت
Jupi Posted July 10, 2016 Posted July 10, 2016 'onClientRender' setPedControlState -- forwards findRotation -- useful func setElementRotation getDistanceBetweenPoints3D
N3xT Posted July 10, 2016 Posted July 10, 2016 وش دخل الـ MoveObject أها ع بالي إنه يبي يخلي اوبجكت يتحرك معه
' A F . Posted July 10, 2016 Posted July 10, 2016 moveObjectأتوقع تحتاج ذا عشان تخليه يتحرك معك هو يبي بيد وليس اوبجكت
#Soking Posted July 10, 2016 Posted July 10, 2016 function Sprint_ ( Element , Stats1 , Stats2 ) setPedControlState( Element ,"forwards", Stats1 ) setPedControlState( Element ,"sprint" , Stats2 ) end function findRotation( x1, y1, x2, y2 ) local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) return t < 0 and t + 360 or t end function Ro_ ( ) local aPlayer_ , aPed_ = { getElementPosition(localPlayer) } , { getElementPosition(Ped_) } local a3D = getDistanceBetweenPoints3D( aPlayer_[1] , aPlayer_[2] , aPlayer_[3] , aPed_[1] , aPed_[2] , aPed_[3] ) setPedRotation(Ped_, findRotation(aPed_[1] , aPed_[2] , aPlayer_[1] , aPlayer_ [2] ) ) if ( a3D <= 3 ) then Sprint_ ( Ped_ , false , false ) else Sprint_ ( Ped_ , true , true ) end end function FunctionCommand_ ( ) local Position = { getElementPosition(localPlayer) } Ped_ = createPed(0, Position[1] + 1, Position[2], Position[3] ) Sprint_ ( Ped_ , true , true ) removeCommandHandler ( "createPed_", FunctionCommand_) addEventHandler('onClientRender', getRootElement ( ) , Ro_ ) addEventHandler('onClientPedWasted',Ped_, function ( ) setTimer ( destroyElement , 5000 , 1, Ped_ ) addCommandHandler("createPed_",FunctionCommand_ ) removeEventHandler('onClientRender', root ,Ro_ ) end ) end addCommandHandler("createPed_",FunctionCommand_ ) ماني مجرب ضض
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