S4MuEL Posted March 24, 2013 Posted March 24, 2013 السلآمم عليكمم ورحمةة الله وبركآتهه الزبدةة , # أنا سويت سكربت مآ شي حآلهه وكل شي بس عندي مشكلةة اللي هي لو ظغطت ع بوتون تجيني الاسلحةة ولو ظغطت بوتون ثآني عشان اخذ الاسلحةة الثآنيةة تظل معي الاسلحةة القديمةة , # رحت للويكي وجربت وتسسذآ وقروشةة ووضعت الكود في الكلنت والسيرفر وأخربط ! ومآ نفع شي .. وش الحل ؟ = \
iPrestege Posted March 24, 2013 Posted March 24, 2013 قصدك عندك زرين زر يعطيك اسلحة وزر ثاني يعطيك اسلحة تبي اذا ضغط الزر الثاني وكان معه اسلحة يسحب الاسلحة الاولى ويعطية الاسلحة الثانية اللي من الزر الثاني؟
yazan Posted March 24, 2013 Posted March 24, 2013 يب يعني نوعين من الفرد لو ضغط الاول يجيه لو ضغط ثاني يروح الاول و يجي ثاني
S4MuEL Posted March 24, 2013 Author Posted March 24, 2013 addEventHandler ( "onClientGUIClick", root, function( state, absoluteX, absolutey ) if (source == GUIEditor.button[1]) then triggerServerEvent ( "giveWeapons1", localPlayer ) elseif (source == GUIEditor.button[2]) then triggerServerEvent ( "giveWeapons2", localPlayer ) elseif (source == GUIEditor.button[3]) then triggerServerEvent ( "giveWeapons3", localPlayer ) end ) server side ------------ addEvent("giveWeapons1", true) addEventHandler("giveWeapons1", root, function() outputChatBox("#00ff00You have received pack of weapons 1 !!", source, 0, 255, 0, true) giveWeapon(source, 24, 150) giveWeapon(source, 31, 150) giveWeapon(source, 34, 150) end) addEvent("giveWeapons2", true) addEventHandler("giveWeapons2", root, function() outputChatBox("#ff0000You have received pack of weapons 2 !!", source, 0, 255, 0, true) giveWeapon(source, 30, 150) giveWeapon(source, 22, 150) giveWeapon(source, 27, 150) end) addEvent("giveWeapons3", true) addEventHandler("giveWeapons3", root, function() outputChatBox("#ffff00You have received pack of weapons 3 !!", source, 0, 255, 0, true) giveWeapon(source, 29, 150) giveWeapon(source, 25, 150) giveWeapon(source, 16, 5) end) هم ثلآثةة أزرآر للعلمم ذذ
iPrestege Posted March 24, 2013 Posted March 24, 2013 -- Client Side -- addEventHandler ( "onClientGUIClick", root, function( state, absoluteX, absolutey ) if (source == GUIEditor.button[1]) then triggerServerEvent ( "giveWeapons1", localPlayer ); elseif (source == GUIEditor.button[2]) then triggerServerEvent ( "giveWeapons2", localPlayer ); elseif (source == GUIEditor.button[3]) then triggerServerEvent ( "giveWeapons3", localPlayer ); end end ); -- Server Side -- addEvent("giveWeapons1", true) addEventHandler("giveWeapons1", root, function ( ) local take = takeAllWeapons ( source ); if ( take ) then giveWeapon(source, 24, 150 ,true); giveWeapon(source, 31, 150 ,true); giveWeapon(source, 34, 150 ,true); outputChatBox("#00ff00You have received pack of weapons 1 !!", source, 0, 255, 0, true); end end ); addEvent("giveWeapons2", true) addEventHandler("giveWeapons2", root, function( ) local take = takeAllWeapons ( source ); if ( take ) then giveWeapon(source, 30, 150 ,true); giveWeapon(source, 22, 150 ,true); giveWeapon(source, 27, 150 ,true); outputChatBox("#ff0000You have received pack of weapons 2 !!", source, 0, 255, 0, true) end end ); addEvent("giveWeapons3", true) addEventHandler("giveWeapons3", root, function() local take = takeAllWeapons ( source ); if ( take ) then giveWeapon(source, 29, 150 , true); giveWeapon(source, 25, 150 ,true); giveWeapon(source, 16, 5 ,true); outputChatBox("#ffff00You have received pack of weapons 3 !!", source, 0, 255, 0, true); end end ); تفضل
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