3ssol Posted January 9, 2014 Posted January 9, 2014 سلام عليكم شباب انا مسوي ماركر بس ابي ااذا لمست الماركر ومامعاك اي سلاح يقول مامعك سلاح واذا معاك سلاح يقول معك سلاح طبعا ابيه يتحقق من كل اسلحتي المهم يكون معاي اي سلاح موب عصي سلاح
3ssol Posted January 9, 2014 Author Posted January 9, 2014 كيف اخليه يتحقق من ان الاعب معاه اسلحه !؟ ماعاد العصي مثل عصت البلياردو او عصتي الشرطي وهكذا ابيه اسلحه ممكن مثال بسيط عليه
فاّرس Posted January 9, 2014 Posted January 9, 2014 سسوي جدول شف ذا مثال , local weapons = {[30] = true,[31] = true} addEventHandler('onClientResourceStart',resourceRoot,function() if weapons[getPedWeapon(localPlayer)] then outputChatBox('لديك اسلحه') else outputChatBox('ليس لديك اسلحه') end end )
3ssol Posted January 9, 2014 Author Posted January 9, 2014 خخ اسلحة العبه كثار انا ابي احط جدول واحط فيه ايدي الاسلحه الي يرفص دخولها المود
jafar Posted January 9, 2014 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
3ssol Posted January 9, 2014 Author Posted January 9, 2014 ابي ااذ لمس بدون اسلحه ماينقل ويقوله مامعك اسلحه واذا معه اسلحه ينقله ينقل الاعب *
jafar Posted January 9, 2014 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
فاّرس Posted January 9, 2014 Posted January 9, 2014 شف الي فهمته انك تبي لو لمس الماركر ومثلا معه عصى بلياردو او حق الشرطه يقوله ما معك اسلحه واذا كان معه رشاش او ...الخ ينقله ؟
فاّرس Posted January 9, 2014 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
jafar Posted January 10, 2014 Posted January 10, 2014 الكود خطأ ! مدامك مستخدم return ليه تستخدم else احين صار إذا الي لمس الماركر مو لاعب ينقله -.-'
3ssol Posted January 10, 2014 Author Posted January 10, 2014 ي ذا بست كودك شغال بس فيه خطا اذا ضغطت زر e يغير السلاح والمس الماركر يقول مامعك سلاح انا ابيه حتي لو معك سلاح بس موماسكه بـيدك يدخلك فهمت ؟
jafar Posted January 10, 2014 Posted January 10, 2014 استخدم الوظيفة الخارجية الا حاطنها ف كودي getPedWeapons
3ssol Posted January 10, 2014 Author Posted January 10, 2014 طيب كيف بيصير مع كود الانتقالات ماعرفتلها واحد يساعدنا ي شباب صارلي يومين انتظركم
3ssol Posted January 10, 2014 Author Posted January 10, 2014 قولو انكم ماتعرفون تسوونه لاتخلوني كل شوي اشوف المنتدي
iPrestege Posted January 10, 2014 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 ) لازم ماتكون بسيارهـ للمعلومية + ضيف الايدي اللي تبية موضح فوق كيفية الاضافة ..
3ssol Posted January 10, 2014 Author Posted January 10, 2014 كفيت ووفيت ي الذيب ضبط 96% 100 بس فيه خطأ بسيط لو نقول انا ابيه مايدخل سلاح العصي حقت الشرطي يعني لو لمست الماركر ومعاك فقط عصي الشرطي مايدخلك بس اذا لمست الماركر وماسك بيدك عصي الشرطي بس معك اسلحه ثانيه يدخلك , انت كودك لو معك اسلحه ومعك عصي الشرطي وماسكها بيدي ولمست الماركر مايدخلني وانا الي ابيه المهم يتحقق ان معك اسلحه ثاانيه غير الي انا احط الايدي حقهم بل جدول فهمت ؟
3ssol Posted January 11, 2014 Author Posted January 11, 2014 كفيت ووفيت ي الذيب ضبط 96% 100بس فيه خطأ بسيط لو نقول انا ابيه مايدخل سلاح العصي حقت الشرطي يعني لو لمست الماركر ومعاك فقط عصي الشرطي مايدخلك بس اذا لمست الماركر وماسك بيدك عصي الشرطي بس معك اسلحه ثانيه يدخلك , انت كودك لو معك اسلحه ومعك عصي الشرطي وماسكها بيدي ولمست الماركر مايدخلني وانا الي ابيه المهم يتحقق ان معك اسلحه ثاانيه غير الي انا احط الايدي حقهم بل جدول فهمت ؟
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