EH10 Posted February 4, 2014 Share Posted February 4, 2014 السلام عليكم طلب فنكشاات ابي كود اذا صوبت على واحد بالسلاح وضغطت حرف ت ياخذ سلاح واحد منه لازم مسافة قريبة Link to comment
al-Kobra Posted February 4, 2014 Share Posted February 4, 2014 'onPlayerTarget' bindKey getElementPosition getDistanceBetweenPoints3D getPedWeapon getPedTotalAmmo takeWeapon giveWeapon Link to comment
EH10 Posted February 4, 2014 Author Share Posted February 4, 2014 وش الـخـطأ * addEventHandler("onPlayerTarget",root,function() bindKey (source,"j","down", end function() local rx,ry,rz,ax,ay,az,px,py,pz = getElementPosition(source) if getDistanceBetweenPoints3D(ax,ay,az,px,py,pz) <= 4 then local wep = getPedWeapon(.....) if ( wep ) then nammo = getPedTotalAmmo(.....) takeWeapon(.....) giveWeapon(.....) end end end ) Link to comment
al-Kobra Posted February 4, 2014 Share Posted February 4, 2014 جرب , addEventHandler ( "onPlayerTarget", root, function ( targetElem ) bindKey (source,"j","down", function( ) local rx,ry,rz = getElementPosition(source) local ax,ay,az = getElementPosition(targetElem) if targetElem and getElementType ( targetElem ) == "player" and getDistanceBetweenPoints3D(rx,ry,rz,ax,ay,az) <= 4 then local wep = getPedWeapon( targetElem ) if ( wep ) then nammo = getPedTotalAmmo( targetElem ) takeWeapon( targetElem, wep, nammo ) giveWeapon( source, wep, nammo) end end end ) end ) Link to comment
EH10 Posted February 4, 2014 Author Share Posted February 4, 2014 جرب , addEventHandler ( "onPlayerTarget", root, function ( targetElem ) bindKey (source,"j","down", function( ) local rx,ry,rz = getElementPosition(source) local ax,ay,az = getElementPosition(targetElem) if targetElem and getElementType ( targetElem ) == "player" and getDistanceBetweenPoints3D(rx,ry,rz,ax,ay,az) <= 4 then local wep = getPedWeapon( targetElem ) if ( wep ) then nammo = getPedTotalAmmo( targetElem ) takeWeapon( targetElem, wep, nammo ) giveWeapon( source, wep, nammo) end end end ) end ) يعطيك العافية ان اشتغل او ماشتغل الله يوفقك دنيا واخره على المساعده امين Link to comment
al-Kobra Posted February 4, 2014 Share Posted February 4, 2014 جرب , addEventHandler ( "onPlayerTarget", root, function ( targetElem ) bindKey (source,"j","down", function( ) local rx,ry,rz = getElementPosition(source) local ax,ay,az = getElementPosition(targetElem) if targetElem and getElementType ( targetElem ) == "player" and getDistanceBetweenPoints3D(rx,ry,rz,ax,ay,az) <= 4 then local wep = getPedWeapon( targetElem ) if ( wep ) then nammo = getPedTotalAmmo( targetElem ) takeWeapon( targetElem, wep, nammo ) giveWeapon( source, wep, nammo) 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