MR.GRAND Posted January 24, 2016 Author Share Posted January 24, 2016 addEventHandler( 'onMarkerHit', root, function(hitElement) if (source == sell_markers[hitElement]) and (getElementType( hitElement ) == "player") then triggerClientEvent(hitElement, 'hitMarkerBuy', hitElement) end end ) Client # setElementData(localPlayer, "allHave#", 0) local Mission_Marker = createMarker (414.92703, 2535.43921, 18.14844, 'Cylinder', 1, 0,255,0,255) local screenW, screenH = guiGetScreenSize() Mission_wnd = guiCreateWindow((screenW - 492) / 2, (screenH - 230) / 2, 492, 230, "# - مهمة تهريب المخدرات - #", false) guiWindowSetSizable(Mission_wnd, false) guiSetAlpha(Mission_wnd, 1.00) guiSetProperty(Mission_wnd, "CaptionColour", "FF29FE00") guiSetVisible(Mission_wnd, false) Cancel_ = guiCreateButton(359, 193, 123, 25, "اغلاق اللوحة #", false, Mission_wnd) guiSetFont(Cancel_, "default-bold-small") guiSetProperty(Cancel_, "NormalTextColour", "FFFFFFFF") Note_ = guiCreateLabel(10, 23, 467, 28, "# عند دخول مهمة بيع المخدرات قم بالذهاب للأماكن المحمية بالخريطة لبيع المخدرات\nلشراء المخدرات قم بأختيار نوع المخدرات التي تود شرائها .", false, Mission_wnd) guiSetFont(Note_, "default-bold-small") guiLabelSetHorizontalAlign(Note_, "right", false) guiLabelSetVerticalAlign(Note_, "center") Mission_Buy_button = guiCreateButton(182, 101, 128, 28, "شـراء البضاعة #", false, Mission_wnd) guiSetFont(Mission_Buy_button, "default-bold-small") guiSetProperty(Mission_Buy_button, "NormalTextColour", "FFFFFFFF") Value_toBuy = guiCreateEdit(344, 101, 133, 28, "العدد #", false, Mission_wnd) Note_Amount = guiCreateLabel(167, 62, 310, 30, "# يجب وضع عدد المخدرات, الحد الأقصى للمخدرات : 100", false, Mission_wnd) guiSetFont(Note_Amount, "default-bold-small") guiLabelSetHorizontalAlign(Note_Amount, "right", false) guiLabelSetVerticalAlign(Note_Amount, "center") Buying_Window = guiCreateWindow((screenW - 437) / 2, (screenH - 515) / 2, 437, 515, "#- لوحة شراء المخدرات -#", false) guiWindowSetSizable(Buying_Window, false) guiSetAlpha(Buying_Window, 1.00) guiSetProperty(Buying_Window, "CaptionColour", "FF05FF00") guiSetVisible(Buying_Window, false) Buying_Note = guiCreateLabel(79, 26, 350, 57, "# قم بأختيار نوع المخدرات التي تريد شرائها\n- ثم ضع عدد المخدرات في الخانة\n- ملاحظة : لايسمح بشراء أكثر من 50 من السلعة المحددة .", false, Buying_Window) guiSetFont(Buying_Note, "default-bold-small") guiLabelSetHorizontalAlign(Buying_Note, "right", false) guiLabelSetVerticalAlign(Buying_Note, "center") Buying_Health = guiCreateRadioButton(131, 98, 297, 26, "# Increased + 20% Health | زيـادة +20% الــصحة", false, Buying_Window) guiSetFont(Buying_Health, "default-bold-small") guiSetProperty(Buying_Health, "NormalTextColour", "FF05FF00") Buying_Damage = guiCreateRadioButton(131, 144, 297, 26, "# Steroids x2 Melee Damage | مـنشطات x2 الضرر", false, Buying_Window) guiSetFont(Buying_Damage, "default-bold-small") guiSetProperty(Buying_Damage, "NormalTextColour", "FF05FF00") Buying_Line1 = guiCreateLabel(9, 124, 420, 21, "ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ", false, Buying_Window) guiSetFont(Buying_Line1, "default-bold-small") guiLabelSetColor(Buying_Line1, 254, 254, 254) guiLabelSetHorizontalAlign(Buying_Line1, "center", false) guiLabelSetVerticalAlign(Buying_Line1, "center") Buying_Speed = guiCreateRadioButton(131, 196, 297, 26, "# Increased Speed for Player | زيادة سرعة الاعب", false, Buying_Window) guiSetFont(Buying_Speed, "default-bold-small") guiSetProperty(Buying_Speed, "NormalTextColour", "FF05FF00") Buying_Line2 = guiCreateLabel(9, 170, 420, 21, "ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ", false, Buying_Window) guiSetFont(Buying_Line2, "default-bold-small") guiLabelSetColor(Buying_Line2, 254, 254, 254) guiLabelSetHorizontalAlign(Buying_Line2, "center", false) guiLabelSetVerticalAlign(Buying_Line2, "center") Buying_Buy_BTN = guiCreateButton(9, 479, 162, 26, "شراء المخدرات", false, Buying_Window) guiSetFont(Buying_Buy_BTN, "default-bold-small") guiSetProperty(Buying_Buy_BTN, "NormalTextColour", "FFFDFEFD") Buying_Cancel_BTN = guiCreateButton(267, 479, 161, 26, "الغاء | اخفاء النافذة", false, Buying_Window) guiSetFont(Buying_Cancel_BTN, "default-bold-small") guiSetProperty(Buying_Cancel_BTN, "NormalTextColour", "FFFDFEFD") Buying_Beer = guiCreateRadioButton(131, 242, 297, 26, "# Buy 1 Of Beer Bottle | شــراء قنيــنــة بيـــرة واحدة", false, Buying_Window) guiSetFont(Buying_Beer, "default-bold-small") guiSetProperty(Buying_Beer, "NormalTextColour", "FF05FF00") Buying_Line3 = guiCreateLabel(9, 221, 420, 21, "ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ", false, Buying_Window) guiSetFont(Buying_Line3, "default-bold-small") guiLabelSetColor(Buying_Line3, 254, 254, 254) guiLabelSetHorizontalAlign(Buying_Line3, "center", false) guiLabelSetVerticalAlign(Buying_Line3, "center") Buying_Line4 = guiCreateLabel(9, 273, 420, 21, "ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ", false, Buying_Window) guiSetFont(Buying_Line4, "default-bold-small") guiLabelSetColor(Buying_Line4, 254, 254, 254) guiLabelSetHorizontalAlign(Buying_Line4, "center", false) guiLabelSetVerticalAlign(Buying_Line4, "center") Buying_Soon = guiCreateRadioButton(131, 294, 297, 26, "# Comming Soon In This Server | قــــريبا التركــيب", false, Buying_Window) guiSetFont(Buying_Soon, "default-bold-small") guiSetProperty(Buying_Soon, "NormalTextColour", "FF05FF00") Buying_Line5 = guiCreateLabel(9, 319, 420, 21, "ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ", false, Buying_Window) guiSetFont(Buying_Line5, "default-bold-small") guiLabelSetColor(Buying_Line5, 254, 254, 254) guiLabelSetHorizontalAlign(Buying_Line5, "center", false) guiLabelSetVerticalAlign(Buying_Line5, "center") Health_edit = guiCreateEdit(19, 99, 103, 25, "# العدد", false, Buying_Window) Damage_edit = guiCreateEdit(18, 145, 103, 25, "# العدد", false, Buying_Window) Speed_edit = guiCreateEdit(18, 197, 103, 25, "# العدد", false, Buying_Window) Beer_edit = guiCreateEdit(18, 243, 103, 25, "# العدد", false, Buying_Window) Soon_edit = guiCreateEdit(19, 295, 103, 25, "# العدد", false, Buying_Window) Bought_wnd = guiCreateWindow((screenW - 434) / 2, (screenH - 476) / 2, 434, 476, "# - لوحـة المشتريـــات - #", false) guiWindowSetSizable(Bought_wnd, false) guiSetAlpha(Bought_wnd, 1.00) guiSetProperty(Bought_wnd, "CaptionColour", "FF41FE00") guiSetVisible(Bought_wnd,false) Bought_Note = guiCreateLabel(29, 22, 395, 61, "# لوحة المشتريات الخاصة بالمخدرات, لشراء المزيد من المخدرات\n- قم بالذهاب إلى باعة المخدرات في المناطق المحمية الخاصة لبيع المخدرات\n- لدخول مهمة بيع المخدرات إذهب إلى ماركر الشراء في الغروب .", false, Bought_wnd) guiSetFont(Bought_Note, "default-bold-small") guiLabelSetHorizontalAlign(Bought_Note, "right", false) guiLabelSetVerticalAlign(Bought_Note, "center") Bought_grid = guiCreateGridList(10, 89, 208, 377, false, Bought_wnd) guiGridListAddColumn(Bought_grid, "# المشتريــات", 0.9) guiSetFont(Bought_grid, "default-bold-small") Bought_Close_BTN = guiCreateButton(392, 439, 32, 27, "X", false, Bought_wnd) guiSetFont(Bought_Close_BTN, "default-bold-small") guiSetProperty(Bought_Close_BTN, "NormalTextColour", "FFFFFFFF") Bought_Usebtn = guiCreateButton(228, 89, 196, 28, "# Use Drug | أستخدام المخدر", false, Bought_wnd) guiSetFont(Bought_Usebtn, "default-bold-small") guiSetProperty(Bought_Usebtn, "NormalTextColour", "FFFFFFFF") Bought_HaveLabel = guiCreateLabel(228, 123, 53, 26, "# Have :", false, Bought_wnd) guiSetFont(Bought_HaveLabel, "default-bold-small") guiLabelSetVerticalAlign(Bought_HaveLabel, "center") Bought_HaveNumber = guiCreateLabel(281, 123, 143, 26, "", false, Bought_wnd) guiSetFont(Bought_HaveNumber, "default-bold-small") guiLabelSetHorizontalAlign(Bought_HaveNumber, "center", false) guiLabelSetVerticalAlign(Bought_HaveNumber, "center") Bought_LOGO = guiCreateLabel(228, 149, 196, 280, "W.T\n------------------\nW.T", false, Bought_wnd) guiSetFont(Bought_LOGO, "sa-gothic") guiLabelSetColor(Bought_LOGO, 61, 217, 0) guiLabelSetHorizontalAlign(Bought_LOGO, "center", false) guiLabelSetVerticalAlign(Bought_LOGO, "center") addEventHandler( 'onClientResourceStart', resourceRoot, function( ) local pName = getPlayerFromName(getPlayerName(localPlayer)) triggerServerEvent("setDataSTART", localPlayer, pName) end ) local pName = getPlayerFromName(getPlayerName(localPlayer)) Bought_Table = { {"Increased Health | الإسعـافات", getElementData(pName, "HaveHealth#")}, {"Steroids Damage | المنــشطات", getElementData(pName, "HaveDamage#")}, {"Increased Speed | الســـرعـة", getElementData(pName, "HaveSpeed#")}, {"Use Beer Bottle | قــنــينــة بيرة", getElementData(pName, "HaveBeer#")}, } for i, add in ipairs(Bought_Table) do local row = guiGridListAddRow(Bought_grid) guiGridListSetItemText(Bought_grid, row, 1, add[1], false, false) guiGridListSetItemData(Bought_grid, row, 1, add[2]) guiGridListSetItemColor(Bought_grid, row,1, 255, 255, 255, 255) end addEventHandler( 'onClientGUIClick', root, function( ) if (source == Bought_Close_BTN) then guiSetVisible(Bought_wnd,false) showCursor(false) elseif (source == Bought_grid) then local Text = guiGridListGetItemData( Bought_grid, guiGridListGetSelectedItem(Bought_grid), 1) guiSetText(Bought_HaveNumber, tostring(Text)) end end ) function BOUGHT_WINDOW() if (guiGetVisible( Bought_wnd ) == false) then guiSetVisible(Bought_wnd, true) showCursor(true) else guiSetVisible(Bought_wnd, false) showCursor(false) end end bindKey( 'Z', 'down', BOUGHT_WINDOW) addEventHandler( 'onClientGUIClick', root, function() local pName = getPlayerFromName(getPlayerName(localPlayer)) if (source == Buying_Buy_BTN) then if (guiRadioButtonGetSelected(Buying_Health) == true) then Health_Amount = guiGetText(Health_edit) if tonumber(Health_Amount) <= 49 then setElementData(pName, "HaveHealth#", tonumber(Health_Amount)) else return end elseif(source == Buying_Buy_BTN) then if (guiRadioButtonGetSelected(Buying_Damage) == true ) then Damage_Amount = guiGetText(Damage_edit) if tonumber(Damage_Amount) <= 49 then setElementData(pName, "HaveDamage#", tonumber(Damage_Amount)) else return end elseif(source == Buying_Buy_BTN) then if (guiRadioButtonGetSelected(Buying_Speed) == true ) then Speed_Amount = guiGetText(Speed_edit) if tonumber(Speed_Amount) <= 49 then setElementData(pName, "HaveSpeed#", tonumber(Speed_Amount)) else return end elseif(source == Buying_Buy_BTN) then if (guiRadioButtonGetSelected(Buying_Beer) == true ) then Beer_Amount = guiGetText(Beer_edit) if tonumber(Beer_Amount) <= 49 then setElementData(pName, "HaveBeer#", tonumber(Beer_Amount)) else return end end end end end end end ) addEventHandler( 'onClientGUIClick', root, function() if (source == Buying_Cancel_BTN) then guiSetVisible(Buying_Window, false) showCursor(false) elseif (source == Health_edit) and ( guiGetText(Health_edit) == "# العدد" ) then guiSetText(Health_edit, "") elseif (source == Damage_edit) and ( guiGetText(Damage_edit) == "# العدد" ) then guiSetText(Damage_edit, "") elseif (source == Speed_edit) and ( guiGetText(Speed_edit) == "# العدد" ) then guiSetText(Speed_edit, "") elseif (source == Beer_edit) and ( guiGetText(Beer_edit) == "# العدد" ) then guiSetText(Beer_edit, "") elseif (source == Buying_Health) and guiRadioButtonGetSelected(Buying_Health) == true then guiSetVisible(Health_edit, true) guiSetVisible(Damage_edit, false) guiSetVisible(Beer_edit, false) guiSetVisible(Speed_edit, false) guiSetVisible(Soon_edit, false) elseif (source == Buying_Damage) and guiRadioButtonGetSelected(Buying_Damage) == true then guiSetVisible(Health_edit, false) guiSetVisible(Damage_edit, true) guiSetVisible(Beer_edit, false) guiSetVisible(Speed_edit, false) guiSetVisible(Soon_edit, false) elseif (source == Buying_Speed) and guiRadioButtonGetSelected(Buying_Speed) == true then guiSetVisible(Health_edit, false) guiSetVisible(Damage_edit, false) guiSetVisible(Beer_edit, false) guiSetVisible(Speed_edit, true) guiSetVisible(Soon_edit, false) elseif (source == Buying_Soon) and guiRadioButtonGetSelected(Buying_Soon) == true then guiSetVisible(Health_edit, false) guiSetVisible(Damage_edit, false) guiSetVisible(Beer_edit, false) guiSetVisible(Speed_edit, false) guiSetVisible(Soon_edit, false) elseif (source == Buying_Beer) and guiRadioButtonGetSelected(Buying_Beer) == true then guiSetVisible(Health_edit, false) guiSetVisible(Damage_edit, false) guiSetVisible(Beer_edit, true) guiSetVisible(Speed_edit, false) guiSetVisible(Soon_edit, false) end end ) addEvent("showBought", true) addEventHandler("showBought", root, function( player ) if (player == localPlayer) then guiSetVisible(Buying_Window, true) showCursor(true) guiSetVisible(Health_edit, false) Link to comment
#DRAGON!FIRE Posted January 24, 2016 Share Posted January 24, 2016 ما ادري ليه تحب تعقد الشغلة ع نفسكـ .. ويعني فهمني هذي الشغلة للان ما فهمتها ليه يوم يدخل الماركر تسوي تريقر بعدين بكلنت ترجع تسوي تريقر وبعدين ترجع تسوي تريقر لكلنت ؟؟؟؟ !!!! سوي تريقر واحد يوم يدخل الماركر وخلاصصص !!! Link to comment
MR.GRAND Posted January 24, 2016 Author Share Posted January 24, 2016 ما ادري ليه تحب تعقد الشغلة ع نفسكـ .. ويعني فهمني هذي الشغلة للان ما فهمتهاليه يوم يدخل الماركر تسوي تريقر بعدين بكلنت ترجع تسوي تريقر وبعدين ترجع تسوي تريقر لكلنت ؟؟؟؟ !!!! سوي تريقر واحد يوم يدخل الماركر وخلاصصص !!! انت مستغرب لآني سويت كذا ! لآكن سويت مثل ماتقول أنت مباشر تريقر من حدث اللمس للكلنت يفتح اللوحة ... والمفروض يفتح لاكن اللوحة ماتفتح يهووووو .... ماحد يرد معقوووول Link to comment
#DRAGON!FIRE Posted January 25, 2016 Share Posted January 25, 2016 هات الكود بعد ما عدلت عليه . Link to comment
MR.GRAND Posted January 25, 2016 Author Share Posted January 25, 2016 هات الكود بعد ما عدلت عليه . --Client addEvent( 'hitMarkerBuy', true) addEventHandler( 'hitMarkerBuy', root, function() guiSetVisible(Buying_Window, true) guiSetVisible(Health_edit, false) guiSetVisible(Damage_edit, false) guiSetVisible(Beer_edit, false) guiSetVisible(Speed_edit, false) guiSetVisible(Soon_edit, false) showCursor(true) end ) --Server addEventHandler('onMarkerHit', root, function(hitElement) if (source == sell_markers[hitElement]) and (getElementType( hitElement ) == "player") then triggerClientEvent(hitElement, 'hitMarkerBuy', hitElement) end end ) Link to comment
#DRAGON!FIRE Posted January 26, 2016 Share Posted January 26, 2016 الكود صحيح .. طبعا انت مسوي تحقق انه لو كان الشخص اللي دخل هو اللي مسوي الماركر يعني لو جا شخص ثاني ودخل ما راح يضبط 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