αвυ-wαleed Posted March 7, 2014 Posted March 7, 2014 ماضبط الكود أي خذا اتمنى التعديل عوضت في كل شيء من هذي لكن ما اشتغل addEvent( "GiveWe", true ) addEventHandler( "GiveWe", root, function( GetShots, ammo ) if ( GetShots and ammo ) then if ( getPlayerMoney( source ) >= GetShots ) then giveWeapon ( source, id, ammo ) takePlayerMoney( source, GetShots ) end end end ) local Label = guiCreateLabel( .... ) addEventHandler( "onClientGUIClick", resourceRoot, function( ) if ( source == Button ) then local Shots = guiGetText( edit ) if ( Shots ~= "" ) then if not ( tonumber( Shots ) ) then return end if ( tonumber( Shots ) > 2000 ) then return end local GetShots = math.floor( tonumber( Shots ) * 40 ) guiSetText( Label, "Money taken: "..GetShots ) triggerServerEvent( "GiveWe", localPlayer, GetShots, tonumber( Shots ) ) end end end )
αвυ-wαleed Posted March 7, 2014 Author Posted March 7, 2014 اكتب في الايديت عدد الطلقات حاط سعرها 40 والقيمة تظهر في الابيل وتضغط الزر وتشتري يعني طلقات
αвυ-wαleed Posted March 7, 2014 Author Posted March 7, 2014 كذا انا مسميها على حسب اللوحة server addEvent( "GiveWe", true ) addEventHandler( "GiveWe", root, function( GetShots, ammo ) if ( GetShots and ammo ) then if ( getPlayerMoney( source ) >= GetShots ) then giveWeapon ( source, 31, ammo ) takePlayerMoney( source, GetShots ) end end end ) clinet local Label = guiCreateLabel( .... ) addEventHandler( "onClientGUIClick", resourceRoot, function( ) if ( source == aa ) then local Shots = guiGetText( bb ) if ( Shots ~= "" ) then if not ( tonumber( Shots ) ) then return end if ( tonumber( Shots ) > 2000 ) then return end local GetShots = math.floor( tonumber( Shots ) * 40 ) guiSetText( cc, "Money taken: "..GetShots ) triggerServerEvent( "GiveWe", localPlayer, GetShots, tonumber( Shots ) ) end end end )
فاّرس Posted March 7, 2014 Posted March 7, 2014 cc = ماهو معرف حط متغير اللبل , + id = غير معرف في ملف سيرفر ويوم قلت لك عرفه يعني انك لازم تحط اي دي السلاح جرب حط مثلا 30 وشوف,,
αвυ-wαleed Posted March 7, 2014 Author Posted March 7, 2014 سطر كم ؟؟؟ متغير اللبل حاطة cc بس أي دي السلاح وين ؟؟ سطر كم
فاّرس Posted March 7, 2014 Posted March 7, 2014 ما انتبهت للسلاح انت مبدله بـ 31 طيب تأكد من ان فلوسك نفس الفلوس الي تطلع في اللبل او اكبر منها ؟
αвυ-wαleed Posted March 7, 2014 Author Posted March 7, 2014 ماطلعت اللوحة مدري اش الخطا الكودين فيها خطا ؟؟ ولالا
αвυ-wαleed Posted March 7, 2014 Author Posted March 7, 2014 هذا كل الكود الكلينت والسيرفر server addEvent( "GiveWe", true ) addEventHandler( "GiveWe", root, function( GetShots, ammo ) if ( GetShots and ammo ) then if ( getPlayerMoney( source ) >= GetShots ) then giveWeapon ( source, 31, ammo ) takePlayerMoney( source, GetShots ) end end end ) clinet GUIEditor_Window = {} GUIEditor_Window[1] = guiCreateWindow(340,250,573,315,"abu-waleed",false) aa = guiCreateButton(23,116,536,81,"شراء",false,GUIEditor_Window[1]) bb = guiCreateEdit(26,20,524,89,"",false,GUIEditor_Window[1]) cc = guiCreateLabel(24,211,531,86,"",false,GUIEditor_Window[1]) local Label = guiCreateLabel( .... ) addEventHandler( "onClientGUIClick", resourceRoot, function( ) if ( source == aa ) then local Shots = guiGetText( bb ) if ( Shots ~= "" ) then if not ( tonumber( Shots ) ) then return end if ( tonumber( Shots ) > 2000 ) then return end local GetShots = math.floor( tonumber( Shots ) * 40 ) guiSetText( cc, "Money taken: "..GetShots ) triggerServerEvent( "GiveWe", localPlayer, GetShots, tonumber( Shots ) ) end end end )
al-Kobra Posted March 7, 2014 Posted March 7, 2014 جرب #Client Side : GUIEditor_Window = {} GUIEditor_Window[1] = guiCreateWindow(340,250,573,315,"abu-waleed",false) aa = guiCreateButton(23,116,536,81,"شراء",false,GUIEditor_Window[1]) bb = guiCreateEdit(26,20,524,89,"",false,GUIEditor_Window[1]) cc = guiCreateLabel(24,211,531,86,"",false,GUIEditor_Window[1]) addEventHandler( "onClientGUIClick", getRootElement ( ), function( ) if ( source == aa ) then local Shots = guiGetText( bb ) if ( Shots ~= "" ) then if not ( tonumber( Shots ) ) then return end if ( tonumber( Shots ) > 2000 ) then guiSetText ( bb, '2000' ) local GetShots = math.floor( tonumber( Shots ) * 40 ) guiSetText( cc, 'Money taken:' ""..GetShots.."" ) triggerServerEvent( "GiveWe", getLocalPlayer ( ), GetShots, tonumber( Shots ) ) end end end end )
#DRAGON!FIRE Posted March 8, 2014 Posted March 8, 2014 (edited) جرب #Client Side : GUIEditor_Window = {} GUIEditor_Window[1] = guiCreateWindow(340,250,573,315,"abu-waleed",false) aa = guiCreateButton(23,116,536,81,"شراء",false,GUIEditor_Window[1]) bb = guiCreateEdit(26,20,524,89,"",false,GUIEditor_Window[1]) cc = guiCreateLabel(24,211,531,86,"",false,GUIEditor_Window[1]) addEventHandler( "onClientGUIClick", getRootElement ( ), function( ) if ( source == aa ) then local Shots = guiGetText( bb ) if ( Shots ~= "" ) then if not ( tonumber( Shots ) ) then return end if ( tonumber( Shots ) > 2000 ) then guiSetText ( bb, '2000' ) local GetShots = math.floor( tonumber( Shots ) * 40 ) guiSetText( cc, 'Money taken:' ""..GetShots.."" ) triggerServerEvent( "GiveWe", getLocalPlayer ( ), GetShots, tonumber( Shots ) ) end end end end ) كانك سويت زي ما سويت بس بـ اختلاف بسيط ذذ Edited March 8, 2014 by Guest
#DRAGON!FIRE Posted March 8, 2014 Posted March 8, 2014 الكود صحيح ما فيه شي .. بس هو محسب انه بـ هذا الكود انتهى السكربت يبي لك اشياء مو كل شي نعطيك هنا .. الكود الاصلي هذا لا تسوي به اي شي الا الاستبدالات الأستبدأل ..... :بـ متغير الزر حقكـ Button سطر 2 : بدل # بـ اسم الأيديت حقكـ edit سطر 3 : بدل # سطر 6 : بدل الرقم 40 بـ سعر الطلقة # سطر 8 : بدل رقم 2000 بعدد اقصى حد للرصاص # سطر 10 : بدل التكست اللي يطلع وقت يشتري # local Label = guiCreateLabel( .... ) addEventHandler( "onClientGUIClick", resourceRoot, function( ) if ( source == Button ) then local Shots = guiGetText( edit ) if ( Shots ~= "" ) then if not ( tonumber( Shots ) ) then return end if ( tonumber( Shots ) > 2000 ) then return end local GetShots = math.floor( tonumber( Shots ) * 40 ) guiSetText( Label, "Money taken: "..GetShots ) triggerServerEvent( "GiveWe", localPlayer, GetShots, tonumber( Shots ) ) end 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