Professional Posted July 14, 2015 Share Posted July 14, 2015 السلام عليكم عندي ذا الكود GUIEditor = { gridlist = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.button[1] = guiCreateButton(301, 331, 139, 55, "اخذ", false) GUIEditor.gridlist[1] = guiCreateGridList(261, 122, 226, 203, false) guiGridListAddColumn(GUIEditor.gridlist[1], "خلاط", 0.9) for i = 1, 9 do guiGridListAddRow(GUIEditor.gridlist[1]) end guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "خلاط", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "باروكا", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "لانشر", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "قنابل", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "كاميرا", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 5, 1, "شوزن", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 6, 1, "ام 4", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 7, 1, "ام بي 5", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 8, 1, "سكين", false, false) end ) addEventHandler("onClientRender", root, function() dxDrawLine(253 - 1, 87 - 1, 253 - 1, 412, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(495, 87 - 1, 253 - 1, 87 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(253 - 1, 412, 495, 412, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(495, 412, 495, 87 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(253, 87, 242, 325, tocolor(16, 250, 209, 97), false) dxDrawLine(252, 104, 493, 106, tocolor(255, 255, 255, 255), 1, false) dxDrawText("مود الاسلحة من قبل Hassan Meke", 251, 85, 495, 107, tocolor(76, 1, 1, 242), 1.00, "default-bold", "center", "center", false, false, false, false, false) end ) انا اعرف اعمله ترايقرات وشله بس مشكلتي هي ان ابيه كيف يعمل تحقق ان الاعب مثلا اختار خلاط يعطيه خلاط ما يعطيه شيئ ثاني قصدي كيف احطهم كلهم ببوتون واحد يا ريت تساعدوني Link to comment
Professional Posted July 14, 2015 Author Share Posted July 14, 2015 اني مثال احط كل الاسلحه ببوتون واحد لما يجي واحد يبي يشتري ام بي 5 مثال يعطيه ام بي 5 اما يعطيه سلاح ثاني Link to comment
Professional Posted July 14, 2015 Author Share Posted July 14, 2015 Server addEvent("38", true) addEventHandler("38", root, function ( ) local money = getPlayerMoney(source) if (money > 1000) then giveWeapon (source , 38 ) outputChatBox ( "لقد حصلت على خلاط", 255, 255, 255, true ) elseif outputChatBox ( "ليس لديك نقود تكفي", 255, 255, 255, true ) end end) Link to comment
Jupi Posted July 14, 2015 Share Posted July 14, 2015 Server addEvent("38", true) addEventHandler("38", root, function ( ) local money = getPlayerMoney(source) if (money > 1000) then giveWeapon (source , 38 ) outputChatBox ( "لقد حصلت على خلاط", 255, 255, 255, true ) elseif outputChatBox ( "ليس لديك نقود تكفي", 255, 255, 255, true ) end end) اولا عندك خطأ هنا لييش حاط elseif ~.~ تصحيح : addEvent("38", true) addEventHandler("38", root, function () local money = getPlayerMoney(source) if (money > 1000) then giveWeapon (source , 38 ) outputChatBox ( "لقد حصلت على خلاط", 255, 255, 255, true ) else outputChatBox ( "ليس لديك نقود تكفي", 255, 255, 255, true ) end end) سويها بتريقر واحد بس بس بملف السيرفر خليه يعطيه السلاح حسب الكلمة المختارة مثال: GUIEditor = { gridlist = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.button[1] = guiCreateButton(301, 331, 139, 55, "اخذ", false) GUIEditor.gridlist[1] = guiCreateGridList(261, 122, 226, 203, false) guiGridListAddColumn(GUIEditor.gridlist[1], "خلاط", 0.9) for i = 1, 9 do guiGridListAddRow(GUIEditor.gridlist[1]) end guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "خلاط", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "باروكا", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "لانشر", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "قنابل", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "كاميرا", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 5, 1, "شوزن", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 6, 1, "ام 4", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 7, 1, "ام بي 5", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 8, 1, "سكين", false, false) end ) addEventHandler("onClientGUIClick", element, function () local weaponname = guiGridListGetItemText(GUIEditor.gridlist[1], GUIEditor.gridlist[1]) triggerServerEvent("giveweapon", localPlayer, weaponname) end ) Server Side addEvent("giveweapon", true) addEventHandler("giveweapon", root, function (weaponname) if weaponname == "اسم السلاح" then --يعطيه علي حسب الاسم elseif weaponname == "اسم السلاح" then --يعطيه علي حسب الاسم end end ) Link to comment
Professional Posted July 14, 2015 Author Share Posted July 14, 2015 نعم حبيبي عارف كل شيئ هنا انا الي ابيه انه بس مثلا يضغط على بازوكا ويضغط اخذ يعطيه بازكا ما يعطيه سلاح ثاني ابي كيف يتحقق 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