3ssol Posted January 9, 2014 Share Posted January 9, 2014 سلام عليكم شباب انا مسوي ماركر بس ابي ااذا لمست الماركر ومامعاك اي سلاح يقول مامعك سلاح واذا معاك سلاح يقول معك سلاح طبعا ابيه يتحقق من كل اسلحتي المهم يكون معاي اي سلاح موب عصي سلاح Link to comment
3ssol Posted January 9, 2014 Author Share Posted January 9, 2014 كيف اخليه يتحقق من ان الاعب معاه اسلحه !؟ ماعاد العصي مثل عصت البلياردو او عصتي الشرطي وهكذا ابيه اسلحه ممكن مثال بسيط عليه Link to comment
فاّرس Posted January 9, 2014 Share Posted January 9, 2014 سسوي جدول شف ذا مثال , local weapons = {[30] = true,[31] = true} addEventHandler('onClientResourceStart',resourceRoot,function() if weapons[getPedWeapon(localPlayer)] then outputChatBox('لديك اسلحه') else outputChatBox('ليس لديك اسلحه') end end ) Link to comment
3ssol Posted January 9, 2014 Author Share Posted January 9, 2014 خخ اسلحة العبه كثار انا ابي احط جدول واحط فيه ايدي الاسلحه الي يرفص دخولها المود Link to comment
jafar Posted January 9, 2014 Share Posted January 9, 2014 -- # Server Side ! local marker = createMarker ( ... ); addEventHandler ( "onMarkerHit", marker, function ( plr ) if getElementType ( plr ) == "player" then if not getPedWeapon ( plr ) then outputChatBox ( "* ليس لديك أي سلاح", plr, 255, 255, 255, true ); else for i, v in ipairs ( getPedWeapons ( plr ) ) do outputChatBox ( "* لديك من الأسلحة " .. getWeaponNameFromID ( v ), plr, 255, 255, 255, true ); end end end end ); getPedWeapons = function ( ped ) local playerWeapons = { }; if ped and isElement ( ped ) and getElementType ( ped ) == "ped" or getElementType ( ped ) == "player" then for i = 0, 12 do if i == 1 then i = 0 end local wep = getPedWeapon ( ped, i ); if wep and wep > 0 then table.insert ( playerWeapons, wep ); end end else return false end return playerWeapons end Link to comment
3ssol Posted January 9, 2014 Author Share Posted January 9, 2014 طيب اذا ابيه ينقل لاعب كيف يصير الكود ؟ Link to comment
jafar Posted January 9, 2014 Share Posted January 9, 2014 قصدك ينقله من مكان لمكان ؟ ولا وش ! Link to comment
3ssol Posted January 9, 2014 Author Share Posted January 9, 2014 ابي ااذ لمس بدون اسلحه ماينقل ويقوله مامعك اسلحه واذا معه اسلحه ينقله ينقل الاعب * Link to comment
jafar Posted January 9, 2014 Share Posted January 9, 2014 -- # Server Side ! local marker = createMarker ( ... ); addEventHandler ( "onMarkerHit", marker, function ( plr ) if getElementType ( plr ) == "player" and not isPedInVehicle ( plr ) then if not getPedWeapon ( plr ) then outputChatBox ( "* ليس لديك أي سلاح", plr, 255, 255, 255, true ); else for i, v in ipairs ( getPedWeapons ( plr ) ) do outputChatBox ( "* لديك من الأسلحة " .. getWeaponNameFromID ( v ), plr, 255, 255, 255, true ); end setElementPosition ( plr, x, y, z ); end end end ); getPedWeapons = function ( ped ) local playerWeapons = { }; if ped and isElement ( ped ) and getElementType ( ped ) == "ped" or getElementType ( ped ) == "player" then for i = 0, 12 do if i == 1 then i = 0 end local wep = getPedWeapon ( ped, i ); if wep and wep > 0 then table.insert ( playerWeapons, wep ); end end else return false end return playerWeapons end Link to comment
فاّرس Posted January 9, 2014 Share Posted January 9, 2014 شف الي فهمته انك تبي لو لمس الماركر ومثلا معه عصى بلياردو او حق الشرطه يقوله ما معك اسلحه واذا كان معه رشاش او ...الخ ينقله ؟ Link to comment
فاّرس Posted January 9, 2014 Share Posted January 9, 2014 (edited) جرب, -- Server Side # local Weapons = {[1]=true,[2]=true,[3]=true,[4]=true,[5]=true,[6]=true,[7]=true,[8]=true,[9]=true,[10]=true,[11]=true,[12]=true,[14]=true,[15]=true,[42]=true,[43]=true,[44]=true,[45]=true} local marker = createMarker(...) addEventHandler('onMarkerHit', marker,function ( plr ) if getElementType ( plr ) == "player" then if getPedWeapon(plr) == 0 or Weapons[getPedWeapon(plr)] then outputChatBox(' ليس لديك اسلحه',plr,255,50,1,true) else if getPedWeapon(plr) > 0 then outputChatBox('لديك اسلحه *',plr,50,50,255,true) setElementPosition(plr,x,y,z) end end end end ) Edited January 10, 2014 by Guest Link to comment
jafar Posted January 10, 2014 Share Posted January 10, 2014 الكود خطأ ! مدامك مستخدم return ليه تستخدم else احين صار إذا الي لمس الماركر مو لاعب ينقله -.-' Link to comment
فاّرس Posted January 10, 2014 Share Posted January 10, 2014 اصلا return مدري كيف كتبت -__-" Link to comment
3ssol Posted January 10, 2014 Author Share Posted January 10, 2014 ي ذا بست كودك شغال بس فيه خطا اذا ضغطت زر e يغير السلاح والمس الماركر يقول مامعك سلاح انا ابيه حتي لو معك سلاح بس موماسكه بـيدك يدخلك فهمت ؟ Link to comment
jafar Posted January 10, 2014 Share Posted January 10, 2014 استخدم الوظيفة الخارجية الا حاطنها ف كودي getPedWeapons Link to comment
3ssol Posted January 10, 2014 Author Share Posted January 10, 2014 طيب كيف بيصير مع كود الانتقالات ماعرفتلها واحد يساعدنا ي شباب صارلي يومين انتظركم Link to comment
3ssol Posted January 10, 2014 Author Share Posted January 10, 2014 قولو انكم ماتعرفون تسوونه لاتخلوني كل شوي اشوف المنتدي Link to comment
iPrestege Posted January 10, 2014 Share Posted January 10, 2014 جرب هذآ و شوف : -- # Server Side .. local marker = createMarker ( x,y,z,'cylinder',2,255,255,255,255 ) local TableWeapons = { [0] = true, [1] = true, -- To Add Weapon [iD] = true, } addEventHandler ( 'onMarkerHit',marker, function ( player ) if getElementType ( player ) == 'player' and not isPedInVehicle ( player ) then local PlayerWeapon = getPedWeapon ( player ) if ( TableWeapons [ PlayerWeapon ] ) then return outputChatBox ( 'عذراً ليس لديك آي سلاح' ) else outputChatBox ( 'حسناً لديك آسلحة' ) setPedArmor ( player,100 ) end end end ) لازم ماتكون بسيارهـ للمعلومية + ضيف الايدي اللي تبية موضح فوق كيفية الاضافة .. Link to comment
3ssol Posted January 10, 2014 Author Share Posted January 10, 2014 كفيت ووفيت ي الذيب ضبط 96% 100 بس فيه خطأ بسيط لو نقول انا ابيه مايدخل سلاح العصي حقت الشرطي يعني لو لمست الماركر ومعاك فقط عصي الشرطي مايدخلك بس اذا لمست الماركر وماسك بيدك عصي الشرطي بس معك اسلحه ثانيه يدخلك , انت كودك لو معك اسلحه ومعك عصي الشرطي وماسكها بيدي ولمست الماركر مايدخلني وانا الي ابيه المهم يتحقق ان معك اسلحه ثاانيه غير الي انا احط الايدي حقهم بل جدول فهمت ؟ Link to comment
3ssol Posted January 11, 2014 Author Share Posted January 11, 2014 كفيت ووفيت ي الذيب ضبط 96% 100بس فيه خطأ بسيط لو نقول انا ابيه مايدخل سلاح العصي حقت الشرطي يعني لو لمست الماركر ومعاك فقط عصي الشرطي مايدخلك بس اذا لمست الماركر وماسك بيدك عصي الشرطي بس معك اسلحه ثانيه يدخلك , انت كودك لو معك اسلحه ومعك عصي الشرطي وماسكها بيدي ولمست الماركر مايدخلني وانا الي ابيه المهم يتحقق ان معك اسلحه ثاانيه غير الي انا احط الايدي حقهم بل جدول فهمت ؟ 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