Abdul KariM Posted February 4, 2016 Share Posted February 4, 2016 (edited) GUIEditor = { button = {}, edit = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(179, 127, 383, 297, "تجربة", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(105, 217, 144, 39, "بيع", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(120, 81, 166, 82, "", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick",root, function() if (source == GUIEditor.button[1]) local sell = guiGetText (GUIEditor.edit[1]) --تجيب الكلام بالايديت triggerServerEvent("money",localPlayer) end end end) ----server addEvent("money",true) addEventHandler("money",root, function() if (getElementData(source,"Iron") = sell) then --تتحقق ان الاعب يملك الكمية التي بالايديت من الداتا removeElementData(source,"Iron",sell) --يسحب منه الداتا على العدد --هنا كود الفلوس ما عرفت اسويه end) ض كم مره اقولك يعني معقوله مافهمت ض سطر 16 سوي فاصلة واكتب sell بالسيرفر بين القوسين حقات الفنكشن sell اكتب سطر 26 ضيف = مره ثانية يعني خليها 2 Edited February 4, 2016 by Guest Link to comment
Ja[B]er[X]Pro Posted February 4, 2016 Author Share Posted February 4, 2016 تم سويتهم ماذا عن الفلوس؟؟ Link to comment
Abdul KariM Posted February 4, 2016 Share Posted February 4, 2016 (edited) تم سويتهم ماذا عن الفلوس؟؟ ضيف هذا السطر تحت الداتا بالسيرفر سايد givePlayerMoney ( source, tonumber ( sell / 2 ) ) طبعا عدد الي يبيعه يقسمه على 2 ويعطيه المبلغ مثلا عنده 50 حديد راح يقسم ال 50 على 2 ويعطيه المبلغ راح يعطيه 25 نص القيمة فهمت عاد انت عدل الي تبيه بالتوفيق Edited February 4, 2016 by Guest Link to comment
Ja[B]er[X]Pro Posted February 4, 2016 Author Share Posted February 4, 2016 تم سويتهم ماذا عن الفلوس؟؟ ضيف هذا السطر بالسيرفر سايد تحت الداتا givePlayerMoney ( source, tonumber ( sell / 2 ) ) طبعا عدد الي يبيعه يقسمه على 2 ويعطيه المبلغ مثلا عنده 50 حديد راح يقسم ال 50 على 2 ويعطيه المبلغ راح يعطيه 25 نص القيمة فهمت عاد انت عدل الي تبيه بالتوفيق شكراً Link to comment
Abdul KariM Posted February 4, 2016 Share Posted February 4, 2016 تم سويتهم ماذا عن الفلوس؟؟ ضيف هذا السطر بالسيرفر سايد تحت الداتا givePlayerMoney ( source, tonumber ( sell / 2 ) ) طبعا عدد الي يبيعه يقسمه على 2 ويعطيه المبلغ مثلا عنده 50 حديد راح يقسم ال 50 على 2 ويعطيه المبلغ راح يعطيه 25 نص القيمة فهمت عاد انت عدل الي تبيه بالتوفيق شكراً العفو , حياك الله Link to comment
Ja[B]er[X]Pro Posted February 6, 2016 Author Share Posted February 6, 2016 اين الخطأأ؟؟؟ ابي عند لمس الماركر تفتح اللوحة وعند كتابة عدد بالايديت والضغط على البوتون يتحقق انه يملك العدد الذي يحتاجه من داتا الايرون ان كان يملك العدد يعطيه سلاح رقم 30 على عدد الايرون ÷2 ويسحب منه الايرون التي استخدمها local marker5 = createMarker (114.19709,1341.90759,10.58594, "cylinder", 1.5, 255, 255, 0, 170 ) wwindow = guiCreateWindow(191, 111, 428, 357, "", false) guiWindowSetSizable(wwindow, false) guiSetVisible(wwindow,false) create = guiCreateButton(119, 64, 186, 61, "Create Weapon", false, wwindow) edit = guiCreateEdit(46, 193, 319, 85, "", false, wwindow) closeb = guiCreateButton(304, 310, 101, 28, "Close", false, wwindow) addEventHandler("onClientMarkerHit",root,marker5, function() guiSetVisible(wwindow,true) showCursor(true) end) addEventHandler("onClientGUIClick",root, function() if (source == create) then local edit = guiGetText(edit) if getElementData(localPlayer,"Iron",edit) triggerServerEvent("weapon",localPlayer) end end end) addEventHandler("onClientGUIClick",root, function() if (source == closeb) then guiSetVisible(wwindow,false) showCursor(false) end end) ---server addEvent("weapon",true) addEventHandler("weapon",root, function() giveWeapon( source, tonumber ( edit / 2 ) ) removeElementData(source,"Iron",edit) end) Link to comment
shwaeki Posted February 6, 2016 Share Posted February 6, 2016 كلنت local Marker = createMarker (114.19709,1341.90759,9.5, "cylinder", 1.5, 255, 255, 0, 170 ) wwindow = guiCreateWindow(191, 111, 428, 357, "", false) guiWindowSetSizable(wwindow, false) guiSetVisible(wwindow,false) create = guiCreateButton(119, 64, 186, 61, "Create Weapon", false, wwindow) edit = guiCreateEdit(46, 193, 319, 85, "", false, wwindow) closeb = guiCreateButton(304, 310, 101, 28, "Close", false, wwindow) addEventHandler("onClientMarkerHit",Marker, function( player ) if ( player == localPlayer and getElementType(player) == "player" ) then guiSetVisible(wwindow,true) showCursor(true) end end) addEventHandler("onClientGUIClick",root, function() if (source == create) then local Amount = tonumber(guiGetText(edit)) if ( type(Amount) == "number" and ( getElementData(localPlayer,"Iron") or 0 ) >= Amount ) then triggerServerEvent("createWeapon",localPlayer, Amount ) end elseif (source == closeb) then guiSetVisible(wwindow,false) showCursor(false) end end) سيرفر addEvent("createWeapon",true) addEventHandler("createWeapon",root, function( Amount ) giveWeapon( source, 30, tonumber ( Amount / 2 ) ) setElementData(source,"Iron", ( getElementData(source,"Iron") or 0 ) - Amount ) end) Link to comment
Ja[B]er[X]Pro Posted February 6, 2016 Author Share Posted February 6, 2016 كلنت local Marker = createMarker (114.19709,1341.90759,9.5, "cylinder", 1.5, 255, 255, 0, 170 ) wwindow = guiCreateWindow(191, 111, 428, 357, "", false) guiWindowSetSizable(wwindow, false) guiSetVisible(wwindow,false) create = guiCreateButton(119, 64, 186, 61, "Create Weapon", false, wwindow) edit = guiCreateEdit(46, 193, 319, 85, "", false, wwindow) closeb = guiCreateButton(304, 310, 101, 28, "Close", false, wwindow) addEventHandler("onClientMarkerHit",Marker, function( player ) if ( player == localPlayer and getElementType(player) == "player" ) then guiSetVisible(wwindow,true) showCursor(true) end end) addEventHandler("onClientGUIClick",root, function() if (source == create) then local Amount = tonumber(guiGetText(edit)) if ( type(Amount) == "number" and ( getElementData(localPlayer,"Iron") or 0 ) >= Amount ) then triggerServerEvent("createWeapon",localPlayer, Amount ) end elseif (source == closeb) then guiSetVisible(wwindow,false) showCursor(false) end end) سيرفر addEvent("createWeapon",true) addEventHandler("createWeapon",root, function( Amount ) giveWeapon( source, 30, tonumber ( Amount / 2 ) ) setElementData(source,"Iron", ( getElementData(source,"Iron") or 0 ) - Amount ) end) thank you Link to comment
Ja[B]er[X]Pro Posted February 6, 2016 Author Share Posted February 6, 2016 (edited) اين الخطأ انا سويت عند الضغط على زر يتحقق انه يملك 1 من كل داتا احددها ان كان معه يسوي ترايقر للسيرفر ويعطيه اسلحة + يمسح 1 من كل داتا احددها وسويتها ايضاً ب2 و3 اين الخطأ؟؟ GUIEditor = { label = {}, } GUIEditor = { button = {} } createwindow = guiCreateWindow(108, 53, 587, 443, "Create Weapon", false) guiWindowSetSizable(createwindow, false) guiSetAlpha(createwindow, 1.00) tap1 = guiCreateTabPanel(9, 22, 569, 410, false, createwindow) tap1 = guiCreateTab("الذخيرة", tap1) b20 = guiCreateButton(10, 26, 105, 47, "صنع ذخيرة", false, tap1) guiSetProperty(b20, "NormalTextColour", "FFFEFFFE") label1 = guiCreateLabel(122, 30, 447, 43, "لاخذ 20 ذخيرة تحتاج 1 حديد,1نحاس,1بارود", false, tap1) guiSetFont(GUIEditor.label[1], "default-bold-small") b40 = guiCreateButton(10, 179, 105, 47, "صنع ذخيرة", false, tap1) guiSetProperty(b40, "NormalTextColour", "FFFEFFFE") label2 = guiCreateLabel(122, 179, 447, 43, "لاخذ 40 ذخيرة تحتاج 2 حديد,2نحاس2بارود", false, tap1) guiSetFont(GUIEditor.label[2], "default-bold-small") b60 = guiCreateButton(10, 320, 105, 47, "صنع ذخيرة", false, tap1) guiSetProperty(b60, "NormalTextColour", "FFFEFFFE") label3 = guiCreateLabel(122, 320, 447, 43, "لاخذ 60 ذخيرة تحتاج 3 حديد,3نحاس3بارود", false, tap1) guiSetFont(GUIEditor.label[3], "default-bold-small") tap2 = guiCreateTab("القنابل", tap1) bsbs = guiCreateButton(10, 24, 127, 53, "صنع القنبلة", false, tap2) guiSetProperty(bsbs, "NormalTextColour", "FFFEFFFE") label4 = guiCreateLabel(147, 29, 395, 48, "لصنع القنبلة تحتاج ل1حديد,1نحاس,1بارود", false, tap2) bb1 = guiCreateButton(0.02, 0.06, 0.22, 0.14, "صنع القنبلة", true, tap2) guiSetProperty(bb1, "NormalTextColour", "FFFEFFFE") bb2 = guiCreateButton(0.02, 0.42, 0.22, 0.14, "صنع القنبلة", true, tap2) guiSetProperty(bb2, "NormalTextColour", "FFFEFFFE") bb3 = guiCreateButton(0.02, 0.81, 0.22, 0.14, "صنع القنبلة", true, tap2) guiSetProperty(bb3, "NormalTextColour", "FFFEFFFE") label5 = guiCreateLabel(147, 164, 395, 48, "لصنع قنبلتان تحتاج ل2حديد,2نحاس,2بارود", false, tap2) label6 = guiCreateLabel(143, 312, 395, 48, "لصنع 3 قنابل تحتاج ل3حديد,3نحاس,3بارود", false, tap2) addEventHandler("onClientGUIClick",root, function() if ( source == b20) then if getElementData(localPlayer,"Iron",1) then if getElementData(localPlayer,"Copper",1) then if getElementData(localPlayer,"Gunpowder",1) then triggerServerEvent ("weaponRemove",localPlayer) end end end end end) addEventHandler("onClientGUIClick",root, function() if ( source == b40) then if getElementData(localPlayer,"Iron",2) then if getElementData(localPlayer,"Copper",2) then if getElementData(localPlayer,"Gunpowder",2) then triggerServerEvent ("weaponRemove2",localPlayer) end end end end end) addEventHandler("onClientGUIClick",root, function() if ( source == b60) then if getElementData(localPlayer,"Iron",3) then if getElementData(localPlayer,"Copper",3) then if getElementData(localPlayer,"Gunpowder",3) then triggerServerEvent ("weaponRemove3",localPlayer) end end end end end) ---server addEvent("weaponRemove",true) addEventHandler("weaponRewmove",root, function() giveWeapon(source,24,20) giveWeapon(source,26,20) giveWeapon(source,27,20) giveWeapon(source,29,20) giveWeapon(source,31,20) giveWeapon(source,34,20) giveWeapon(source,39,20) giveWeapon(source,26,20) giveWeapon(source,25,20) removeElementData (source,"Iron",1) removeElementData (source, "Copper",1) removeElementData (source, "Gunpowder",1) end) addEvent("weaponRemovew",true) addEventHandler("weaponRewmovew",root, function() giveWeapon(source,24,40) giveWeapon(source,26,40) giveWeapon(source,27,40) giveWeapon(source,29,40) giveWeapon(source,31,40) giveWeapon(source,34,40) giveWeapon(source,39,40) giveWeapon(source,26,40) giveWeapon(source,25,40) removeElementData (source,"Iron",2) removeElementData (source, "Copper",2) removeElementData (source, "Gunpowder",2) end) addEvent("weaponRemovee",true) addEventHandler("weaponRewmovee",root, function() giveWeapon(source,24,60) giveWeapon(source,26,60) giveWeapon(source,27,60) giveWeapon(source,29,60) giveWeapon(source,31,60) giveWeapon(source,34,60) giveWeapon(source,39,60) giveWeapon(source,26,60) giveWeapon(source,25,60) removeElementData (source,"Iron",3) removeElementData (source, "Copper",3) removeElementData (source, "Gunpowder",3) end) Edited February 6, 2016 by Guest Link to comment
#HMO-GODA Posted February 6, 2016 Share Posted February 6, 2016 اعتقد مافيه خطاا بس ماقراته كله Link to comment
Ja[B]er[X]Pro Posted February 6, 2016 Author Share Posted February 6, 2016 اعتقد مافيه خطاا بس ماقراته كله الكود هريسة كيف ما في اخطاء ضض Link to comment
shwaeki Posted February 7, 2016 Share Posted February 7, 2016 (edited) جرب كلنت addEventHandler("onClientGUIClick",root, function() if ( source == b20) then if (getElementData (localPlayer,"Iron") or 0) >= 1 then if (getElementData (localPlayer,"Copper") or 0) >= 1 then if (getElementData (localPlayer,"Gunpowder") or 0) >= 1 then triggerServerEvent ("weaponRemove",localPlayer) end end end elseif ( source == b40) then if (getElementData (localPlayer,"Iron") or 0) >= 2 then if (getElementData (localPlayer,"Copper") or 0) >= 2 then if (getElementData (localPlayer,"Gunpowder") or 0) >= 2 then triggerServerEvent ("weaponRemove2",localPlayer) end end end elseif ( source == b60) then if (getElementData (localPlayer,"Iron") or 0) >= 3 then if (getElementData (localPlayer,"Copper") or 0) >= 3 then if (getElementData (localPlayer,"Gunpowder") or 0) >= 3 then triggerServerEvent ("weaponRemove3",localPlayer) end end end end end) سيرفر addEvent("weaponRemove",true) addEventHandler("weaponRewmove",root, function() giveWeapon(source,24,20) giveWeapon(source,26,20) giveWeapon(source,27,20) giveWeapon(source,29,20) giveWeapon(source,31,20) giveWeapon(source,34,20) giveWeapon(source,39,20) giveWeapon(source,26,20) giveWeapon(source,25,20) setElementData(source, "Iron", (getElementData (source,"Iron") or 0) - 1) setElementData(source, "Copper", (getElementData (source,"Copper") or 0) - 1) setElementData(source, "Gunpowder", (getElementData (source,"Gunpowder") or 0) - 1) end) addEvent("weaponRemovew",true) addEventHandler("weaponRewmovew",root, function() giveWeapon(source,24,40) giveWeapon(source,26,40) giveWeapon(source,27,40) giveWeapon(source,29,40) giveWeapon(source,31,40) giveWeapon(source,34,40) giveWeapon(source,39,40) giveWeapon(source,26,40) giveWeapon(source,25,40) setElementData(source, "Iron", (getElementData (source,"Iron") or 0) - 2) setElementData(source, "Copper", (getElementData (source,"Copper") or 0) - 2) setElementData(source, "Gunpowder", (getElementData (source,"Gunpowder") or 0) - 2) end) addEvent("weaponRemovee",true) addEventHandler("weaponRewmovee",root, function() giveWeapon(source,24,60) giveWeapon(source,26,60) giveWeapon(source,27,60) giveWeapon(source,29,60) giveWeapon(source,31,60) giveWeapon(source,34,60) giveWeapon(source,39,60) giveWeapon(source,26,60) giveWeapon(source,25,60) setElementData(source, "Iron", (getElementData (source,"Iron") or 0) - 3) setElementData(source, "Copper", (getElementData (source,"Copper") or 0) - 3) setElementData(source, "Gunpowder", (getElementData (source,"Gunpowder") or 0) - 3) end) Edited February 7, 2016 by Guest Link to comment
</Mr.Tn6eL> Posted February 7, 2016 Share Posted February 7, 2016 شويكي سطر 5 قوس زايد if ((getElementData (localPlayer,"Copper") or 0) >= 1 then Link to comment
shwaeki Posted February 7, 2016 Share Posted February 7, 2016 شويكي سطر 5 قوس زايد if ((getElementData (localPlayer,"Copper") or 0) >= 1 then تسلم تم التعديل Link to comment
Ja[B]er[X]Pro Posted February 7, 2016 Author Share Posted February 7, 2016 اجت مشكلة باللوحة اول ما اشغل المود يجي لي البوتون صنع القنبلة +كل الليبل التي بالتاب التاني بوجهي بالاول كان يجي اكتر لكن حليتها كانت المشكلة ان false بصنع اللوحة كانت ture اما الان ما اعرف المشكلة local Marker = createMarker (114.19709,1341.90759,9.5, "cylinder", 1.5, 255, 255, 0, 170 ) createwindow = guiCreateWindow(108, 53, 587, 443, "Create Weapon", false) guiWindowSetSizable(createwindow, false) guiSetAlpha(createwindow, 1.00) guiSetVisible(createwindow,false) tap1 = guiCreateTabPanel(9, 22, 569, 410, false, createwindow) tap1 = guiCreateTab("الذخيرة", tap1) b20 = guiCreateButton(10, 26, 105, 47, "صنع ذخيرة", false, tap1) guiSetProperty(b20, "NormalTextColour", "FFFEFFFE") label1 = guiCreateLabel(122, 30, 447, 43, "لاخذ 20 ذخيرة تحتاج 1 حديد,1نحاس,1بارود", false, tap1) guiSetFont(label1, "default-bold-small") b40 = guiCreateButton(10, 179, 105, 47, "صنع ذخيرة", false, tap1) guiSetProperty(b40, "NormalTextColour", "FFFEFFFE") label2 = guiCreateLabel(122, 179, 447, 43, "لاخذ 40 ذخيرة تحتاج 2 حديد,2نحاس2بارود", false, tap1) guiSetFont(label2, "default-bold-small") b60 = guiCreateButton(10, 320, 105, 47, "صنع ذخيرة", false, tap1) guiSetProperty(b60, "NormalTextColour", "FFFEFFFE") label3 = guiCreateLabel(122, 320, 447, 43, "لاخذ 60 ذخيرة تحتاج 3 حديد,3نحاس3بارود", false, tap1) guiSetFont(label3, "default-bold-small") tap2 = guiCreateTab("القنابل", tap1) bsbs = guiCreateButton(10, 24, 127, 53, "صنع القنبلة", false, tap2) guiSetProperty(bsbs, "NormalTextColour", "FFFEFFFE") label4 = guiCreateLabel(147, 29, 395, 48, "لصنع القنبلة تحتاج ل1حديد,1نحاس,1بارود", false, tap2) bb1 = guiCreateButton(0.02, 0.06, 0.22, 0.14, "صنع القنبلة", false, tap2) guiSetProperty(bb1, "NormalTextColour", "FFFEFFFE") bb2 = guiCreateButton(0.02, 0.42, 0.22, 0.14, "صنع القنبلة", false, tap2) guiSetProperty(bb2, "NormalTextColour", "FFFEFFFE") bb3 = guiCreateButton(0.02, 0.81, 0.22, 0.14, "صنع القنبلة", false, tap2) guiSetProperty(bb3, "NormalTextColour", "FFFEFFFE") label5 = guiCreateLabel(147, 164, 395, 48, "لصنع قنبلتان تحتاج ل2حديد,2نحاس,2بارود", false, tap2) label6 = guiCreateLabel(143, 312, 395, 48, "لصنع 3 قنابل تحتاج ل3حديد,3نحاس,3بارود", false, tap2) addEventHandler("onClientMarkerHit",marker5, function() guiSetVisible(createwindow,true) showCursor(true) end) addEventHandler("onClientGUIClick",root, function() if ( source == b20) then if (getElementData (localPlayer,"Iron") or 0) >= 1 then if (getElementData (localPlayer,"Copper") or 0) >= 1 then if (getElementData (localPlayer,"Gunpowder") or 0) >= 1 then triggerServerEvent ("weaponRemove",localPlayer) end end end elseif ( source == b40) then if (getElementData (localPlayer,"Iron") or 0) >= 2 then if (getElementData (localPlayer,"Copper") or 0) >= 2 then if (getElementData (localPlayer,"Gunpowder") or 0) >= 2 then triggerServerEvent ("weaponRemove2",localPlayer) end end end elseif ( source == b60) then if (getElementData (localPlayer,"Iron") or 0) >= 3 then if (getElementData (localPlayer,"Copper") or 0) >= 3 then if (getElementData (localPlayer,"Gunpowder") or 0) >= 3 then triggerServerEvent ("weaponRemove3",localPlayer) end end end end end) Link to comment
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