#StrOnG_,) Posted January 12, 2016 Posted January 12, 2016 السلام عليكم ممكن مثال لهذا الفنكشن ؟ math.random ابي اذا يكتب كلمه باف 8 يعطي اسلحة عشوائية محددة وشكراً
Abdul KariM Posted January 12, 2016 Posted January 12, 2016 عليكم السلام شوف هذا الشرح من اخونا زاحف https://forum.multitheftauto.com/viewtopic.php?f=164&t=57985 وشوف هذا المثال الي تبيه TheWeapon = { 38 ,30 ,25 } addCommandHandler("GiveMe", function ( player , cmd ) giveWeapon( player,TheWeapon[ math.random ( #TheWeapon ) ]) end ); بالتوفيق ان شاء الله
#StrOnG_,) Posted January 12, 2016 Author Posted January 12, 2016 عليكم السلام شوف هذا الشرح من اخونا زاحف https://forum.multitheftauto.com/viewtopic.php?f=164&t=57985 وشوف هذا المثال الي تبيه TheWeapon = { 38 ,30 ,25 } addCommandHandler("GiveMe", function ( player , cmd ) giveWeapon( player,TheWeapon[ math.random ( #TheWeapon ) ]) end ); بالتوفيق ان شاء الله مشكور , امين وياك ^
SycroX Posted January 12, 2016 Posted January 12, 2016 (edited) addCommandHandler("TakeWep", function (plr) local RandomWeapon = math.random(0,38) giveWeapon(plr, RandomWeapon) exports["guimessages"]:outputServer(plr,"You Take"..tonumber(RandomWeapon).." Weapon) From Your Random Given",0,255,0) end ) Edited January 12, 2016 by Guest
#StrOnG_,) Posted January 12, 2016 Author Posted January 12, 2016 addCommandHandler("TakeMoney", function (plr) local RandomMoney = math.random(100,1000) setPlayerMoney(plr, RandomMoney) exports["guimessages"]:outputServer(plr,"You Take"..tonumber(RandomMoney).."$) From Your Random Given",0,255,0) end ) تشوف ؟ ولا اجيب لك نظارات ؟ قلت اسلحة مو فلوس + فادوني فوق !
SycroX Posted January 12, 2016 Posted January 12, 2016 عدلتها اهو يجيب لك من سلاح 0 لي 38 الخلاط و يعطيك واحد منهم طبعا لو تبي تجيب اسم السلاح استعمل getWeaponNameFromID
#StrOnG_,) Posted January 12, 2016 Author Posted January 12, 2016 عدلتها اهو يجيب لك من سلاح 0 لي 38 الخلاط و يعطيك واحد منهم # قلت فادوني فوق عبد الكريم عطاني الي ابيه ومشكور.
SycroX Posted January 12, 2016 Posted January 12, 2016 عفو بس طريقتي شي و طريقة عبد الكريم شي هو مسوي جدول و انا مسوي من سلاح الي سلاح تبي تسوي بطريقة عبد الكريم هي صح بس هتقعد تضيف كل الاسلحة فلجدول
Abdul KariM Posted January 12, 2016 Posted January 12, 2016 عفوبس طريقتي شي و طريقة عبد الكريم شي هو مسوي جدول و انا مسوي من سلاح الي سلاح تبي تسوي بطريقة عبد الكريم هي صح بس هتقعد تضيف كل الاسلحة فلجدول ردي كافي وبعدين لو انت سويت يختار من 10 الى 1000 بعض في بعض الارقام مالها وجود بالاصح مالها سلاح وكذا راح يصير لاق او بق عشان كذا يحط ايديات صحيحة فهمت كيف عليكم السلام شوف هذا الشرح من اخونا زاحف https://forum.multitheftauto.com/viewtopic.php?f=164&t=57985 وشوف هذا المثال الي تبيه TheWeapon = { 38 ,30 ,25 } addCommandHandler("GiveMe", function ( player , cmd ) giveWeapon( player,TheWeapon[ math.random ( #TheWeapon ) ]) end ); بالتوفيق ان شاء الله مشكور , امين وياك ^ العفو , حياك الله
MuhannaDx Posted January 12, 2016 Posted January 12, 2016 Weapon = { "colt 45", "mp5", "ak-47", "tec-9", "minigun", } function MuhannaDxP( command ) if command == "GiveMeWeapon" then Randoms = Weapon [ math.random ( #Weapon ) ] setWeapon = getWeaponIDFromName ( Randoms ) giveWeapon ( source, setWeapon,80, true ) else outputChatBox ( "غـلـط", source, 255, 0, 0, true ) end end addEventHandler ("onPlayerCommand", root, MuhannaDxP )
#StrOnG_,) Posted January 12, 2016 Author Posted January 12, 2016 ياربي يالله ياخي شفيكم ؟ قلت تمت الافادة الف مره لازم اقولها ؟
MuhannaDx Posted January 12, 2016 Posted January 12, 2016 اخوي حنا اعطيناك طرق شوف الي تعجبك وخذها ذذ
Recommended Posts