ghassen14 Posted October 1, 2015 Posted October 1, 2015 السلام عليكم شباب ابي كود لما يضغط زر يعطيه سلاح و شكرا شباب
#|_oskar_|# Posted October 1, 2015 Posted October 1, 2015 Client onClientGUIClick triggerServerEvent Server addEvent giveWeapon لا اله الا انت سبحانك اني كنت من الظالمين My Group : https://www.facebook.com/groups/992678147519191/
khaledmhammed Posted October 1, 2015 Posted October 1, 2015 -- client -- Event : onClientGUIClick addEventHandler function () if source == الزر then triggerServerEvent -- server -- addEvent addEventHandler function () giveWeapon https://forum.multitheftauto.com/viewtopic.php?f=160&t=93303 -- هذا المثال نفس طلبك بس بدل فنكشن السيرفر باللي تبي ألـحسـأب مستخدم من قبـل ~ # ألـدب ~ و العصل ~ #
Mr.R Posted October 1, 2015 Posted October 1, 2015 #Client Side addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == اسم الزر ) then triggerServerEvent ( "Minigun", localPlayer ) -- ترايقر لسيرفر عشان لايكون السلاح وهمي end end ) #Server Side addEvent( "Minigun", true ) addEventHandler ( "Minigun", root, function ( ) if ( getPlayerMoney ( source ) >= 4000 ) then takePlayerMoney ( source, 4000 ) -- يأخذ منه 4 الاف سعر السلاح giveWeapon ( source , 38, 10000 ) -- العشر الاف الرصاص الي يجي بالسلاح والـ38 ايدي السلاح setPedWeaponSlot ( source, getSlotFromWeapon ( 38 ) ) -- ايدي السلاح outputChatBox ( "* " .. getPlayerName ( source ) .. " Has Bought Weapon [ Minigun ]", root, 255, 255, 255, true )-- مخرج شات else outputChatBox ( "* You don't have $4000 to buy [ Minigun ]", source, 255, 255, 255, true )-- مخرج شات end end ) * There is no God but Allah, Mohammed is the Messenger Of Allah
khaledmhammed Posted October 1, 2015 Posted October 1, 2015 #Client Side addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == اسم الزر ) then triggerServerEvent ( "Minigun", localPlayer ) -- ترايقر لسيرفر عشان لايكون السلاح وهمي end end ) #Server Side addEvent( "Minigun", true ) addEventHandler ( "Minigun", root, function ( ) if ( getPlayerMoney ( source ) >= 4000 ) then takePlayerMoney ( source, 4000 ) -- يأخذ منه 4 الاف سعر السلاح giveWeapon ( source , 38, 10000 ) -- العشر الاف الرصاص الي يجي بالسلاح والـ38 ايدي السلاح setPedWeaponSlot ( source, getSlotFromWeapon ( 38 ) ) -- ايدي السلاح outputChatBox ( "* " .. getPlayerName ( source ) .. " Has Bought Weapon [ Minigun ]", root, 255, 255, 255, true )-- مخرج شات else outputChatBox ( "* You don't have $4000 to buy [ Minigun ]", source, 255, 255, 255, true )-- مخرج شات end end ) السطر ذا if ( getPlayerMoney ( source ) >= 4000 ) then يتحقق لو معه المبلغ او لا عشان ماتكون الفلوس سالب ولا؟ ألـحسـأب مستخدم من قبـل ~ # ألـدب ~ و العصل ~ #
` Allawi Posted October 1, 2015 Posted October 1, 2015 السطر ذا if ( getPlayerMoney ( source ) >= 4000 ) then يتحقق لو معه المبلغ او لا عشان ماتكون الفلوس سالب ولا؟ يتحقق منها كلها راح يتحقق انه الفلوس مو سالب وراح يتحقق ان فلوسه اكثر من 4000
ghassen14 Posted October 1, 2015 Author Posted October 1, 2015 شباب وين الخطأ انا لما اضغط الزر ما اشتغل addEvent( "Usi", true ) addEventHandler ( "Usi", root, function ( ) if ( getPlayerMoney ( source ) >= 100 ) then takePlayerMoney ( source, 100 ) giveWeapon ( source , 28, 10000 ) setPedWeaponSlot ( source, getSlotFromWeapon ( 28) ) outputChatBox ( "* " .. getPlayerName ( source ) .. " Has Bought Weapon [ Usi ]", root, 255, 255, 255, true ) else outputChatBox ( "* You don't have $4000 to buy [ Usi ]", source, 255, 255, 255, true ) end end )
Mr.R Posted October 1, 2015 Posted October 1, 2015 شباب وين الخطأ انا لما اضغط الزر ما اشتغل addEvent( "Usi", true ) addEventHandler ( "Usi", root, function ( ) if ( getPlayerMoney ( source ) >= 100 ) then takePlayerMoney ( source, 100 ) giveWeapon ( source , 28, 10000 ) setPedWeaponSlot ( source, getSlotFromWeapon ( 28) ) outputChatBox ( "* " .. getPlayerName ( source ) .. " Has Bought Weapon [ Usi ]", root, 255, 255, 255, true ) else outputChatBox ( "* You don't have $4000 to buy [ Usi ]", source, 255, 255, 255, true ) end end ) مافيه خطأ , اطرح الكلينت * There is no God but Allah, Mohammed is the Messenger Of Allah
ghassen14 Posted October 1, 2015 Author Posted October 1, 2015 client addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[2]) then triggerServerEvent ( "Usi", localPlayer ) end end ) +اعطيني سكايبك
GraveDigger. Posted October 1, 2015 Posted October 1, 2015 في سطر "2" اتأكد انك حاط اسم الزر صح Edit : و بطريقة احسن function Give() triggerServerEvent ( "Usi",localPlayer) end addEventHandler ( "onClientGUIClick",الأسم, Give, false )
Mr.R Posted October 1, 2015 Posted October 1, 2015 client addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[2]) then triggerServerEvent ( "Usi", localPlayer ) end end ) +اعطيني سكايبك ماشوف فيه اي خطأ + تأكد من اسم الزر ادخل فالوكيند بس Httttt7.Ksa وبالنسبه للسكايب تفضل : ) * There is no God but Allah, Mohammed is the Messenger Of Allah
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