MR.GRAND Posted July 25, 2015 Share Posted July 25, 2015 (edited) السلام عليكم ورحمة الله وبركاته اليوم ابي اسوي مود وهو لوحة فيها فراغين ايديت بوكس واحد تحط فيه سيريال اللاعب والثاني النص حق التاج اللي يبيه اللاعب وفي زر تفعيل التاج للاعب طبعا الزر لما اضغطه مرة يتحول النص إلى الغاء تفعيل التاج ولما ادوس الغاء تفعيل الزر يرجع إلى تفعيل التاج طبعا مو هذا اللي نبيه , اللي نبيه هو انكم تعطوني الفنكشنات اللي تاخذ النص والسيريال حق اللاعب وتسوي التاج له ويكون افضل لو تعطوني مثال الكلنت : local key = "F5" GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() T_WND = guiCreateWindow((screenW - 454) / 2, (screenH - 364) / 2, 454, 364, "~.* Player TAG - Panel *.~", false) guiWindowSetSizable(T_WND, false) guiSetProperty(T_WND, "CaptionColour", "FF29FF00") guiSetVisible(T_WND,false) GUIEditor.label[1] = guiCreateLabel(10, 29, 429, 17, "* Note : You can put Player serial and TAG Text for can show it in CHAT box", false, T_WND) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 255, 0, 0) GUIEditor.label[2] = guiCreateLabel(10, 67, 98, 16, "* Player serial :-", false, T_WND) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 47, 255, 0) T_Serial = guiCreateEdit(110, 67, 329, 18, "", false, T_WND) GUIEditor.label[3] = guiCreateLabel(10, 93, 98, 16, "* Player TAG :-", false, T_WND) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 5, 0, 255) T_TAG = guiCreateEdit(110, 91, 329, 18, "", false, T_WND) T_Enable = guiCreateButton(193, 123, 163, 28, "Enable TAG for Player", false, T_WND) guiSetFont(T_Enable, "default-bold-small") guiSetProperty(T_Enable, "NormalTextColour", "FFF6FF00") T_Close = guiCreateButton(356, 334, 88, 20, "Close", false, T_WND) guiSetFont(T_Close, "default-bold-small") guiSetProperty(T_Close, "NormalTextColour", "FFFF0000") GUIEditor.label[4] = guiCreateLabel(9, 334, 257, 20, "2015", false, T_WND) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetColor(GUIEditor.label[4], 0, 234, 255) GUIEditor.label[5] = guiCreateLabel(434, 151, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetColor(GUIEditor.label[5], 38, 38, 38) GUIEditor.label[6] = guiCreateLabel(10, 147, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[6], "default-bold-small") guiLabelSetColor(GUIEditor.label[6], 38, 38, 38) function Show_Hide() if guiGetVisible(T_WND) == false then guiSetVisible(T_WND, true) showCursor(true) else guiSetVisible(T_WND, false) showCursor(false) end end bindKey(key,"down",Show_Hide) addEventHandler("onClientGUIClick",root, function () if source == T_Close then if(guiGetVisible(T_WND) == false)then end guiSetVisible(T_WND,false) showCursor(false) guiSetInputEnabled(false) end end) addEventHandler("onClientGUIClick",root, function () if source == T_Enable then local text = (guiGetText(T_Enable)) if ( text == "Enable TAG for Player" ) then guiSetText(T_Enable,"Disable TAG for player") TimerEnabled = setTimer ( guiSetText, 3000, 1, source, "Disable TAG for player" ) guiSetEnabled(source, false) setTimer(guiSetEnabled, 3000, 1, T_Enable, true) end local text = (guiGetText(T_Enable)) if ( text == "Disable TAG for player" ) then guiSetText(T_Enable,"Enable TAG for Player") guiSetEnabled(source, false) setTimer(guiSetEnabled, 3000, 1, T_Enable, true) end end end ) اتمنى تردون بسرعة Edited August 24, 2015 by Guest Link to comment
' A F . Posted July 25, 2015 Share Posted July 25, 2015 (edited) setElementData Edited July 25, 2015 by Guest Link to comment
MR.GRAND Posted July 25, 2015 Author Share Posted July 25, 2015 [/lua]setElementData[/lua] طيب وين الباقي ؟ ذا جزء بس انا ابي الفنكشنات كاملين + مثال بسيط عنهم Link to comment
H25 Posted July 25, 2015 Share Posted July 25, 2015 (edited) تستخدم guiGetText علشان تاخذ السيريال واسم التاج اما بخصوص تفعيل التاج فاستخدم داتا مثال تقدر تستخدمه function setPlayerTag(source, tagName) if type(tagName) == "string" then setElementData(source, "TAG", tagName) return true elseif type(tagName) == "boolean" and tagName == false then removeElementData(source, "TAG") return true else return false end end وتستخدم "onPlayerChat" -- Event تسوي تحقق للداتا اذا كانت موجودة او لا وطبعاً اذا تبي تحفظ التاج استخدم الاكاونت داتا setAccountData getAccountData Edited July 26, 2015 by Guest Link to comment
MR.GRAND Posted July 25, 2015 Author Share Posted July 25, 2015 ممكن مثال ؟ ابي مثال كامل على الاكاونت داتا لحفظ التاج ع السيريال Link to comment
MR.GRAND Posted July 25, 2015 Author Share Posted July 25, 2015 ابي احد يفهمني وش القصة , ابي يدخلون الكبار تابل , برستج , سعد ... الخ Link to comment
i S6O Posted July 26, 2015 Share Posted July 26, 2015 ياخوي انت فاهم البرمجه غلط تحسب اي واحد من المبرمجين الكبار هم بس يعرفون كل شيء ترا حتى الي ماهو من المبرمجين الكبار يعرف هو عطاك زي كذا guiGetText setAccountData getAccountData انت وش تسوي الحين تروح عند الكلامات ذي الي بالالوان ثم تظغط Ctrl + ماوس اليسار وتقرا الموقع الي يطلع لك وتفهمه زين Link to comment
' A F . Posted July 26, 2015 Share Posted July 26, 2015 تستخدم guiGetText علشان تاخذ السيريال واسم التاج اما بخصوص تفعيل التاج فاستخدم داتا مثال تقدر تستخدمه function setPlayerTag(tagName) if type(tagName) == "string" then setElementData(localPlayer, "TAG", tagName) return true elseif type(tagName) == "boolean" and tagName == false then removeElementData(localPlayer, "TAG") return true else return false end end وتستخدم "onPlayerChat" -- Event تسوي تحقق للداتا اذا كانت موجودة او لا وطبعاً اذا تبي تحفظ التاج استخدم الاكاونت داتا setAccountData getAccountData مم localPlayer > كلنت removeElementData > سيرفر ذذ Link to comment
H25 Posted July 26, 2015 Share Posted July 26, 2015 تستخدم guiGetText علشان تاخذ السيريال واسم التاج اما بخصوص تفعيل التاج فاستخدم داتا مثال تقدر تستخدمه function setPlayerTag(tagName) if type(tagName) == "string" then setElementData(localPlayer, "TAG", tagName) return true elseif type(tagName) == "boolean" and tagName == false then removeElementData(localPlayer, "TAG") return true else return false end end وتستخدم "onPlayerChat" -- Event تسوي تحقق للداتا اذا كانت موجودة او لا وطبعاً اذا تبي تحفظ التاج استخدم الاكاونت داتا setAccountData getAccountData مم localPlayer > كلنت removeElementData > سيرفر ذذ تم التعديل ومو ضروري يستخدم removeElementData يقدر يسوي القيمة فولس او نيل Link to comment
Ac[T]ioN Posted July 26, 2015 Share Posted July 26, 2015 بص معي فكرة أفضل بكثير أنا سويته وهي إنك تسوي جريد ليست فيه أسماء الاعبين وزر وإديت وإختار الاعب من الجريد ليست وسوي فنكشن تغير الإسم ويوم تكتب في الإديت يتغير للإسم اللي تبيه وتضغط علي الزر يحفظ الداتا في حسابه وخلاص Link to comment
MR.GRAND Posted July 29, 2015 Author Share Posted July 29, 2015 شباب فزعتكم انا سويت كذا بس لما يجي يتحقق من أن السيريال = التكست اللي بالايديت مايقدر او في خطأ اتمنى تصلحون .. سيرفر : addEventHandler('onPlayerChat',root, function (text, msgtype) local SERIAL = triggerClientEvent('GET',source) if ()getPlayerSerial(source) == SERIAL) then outputChatBox('#33FFCC=[#FF0000Server#FF0099OWNER#33FFCC]= #cc0000*#FFFF00[#FF00ccMR.#00ffccGRAND#FFFF00]#cc0000* ~:#ffffff'.. text, root, 255, 255, 255, true) end end ) -- 3FF2E7C91279184D3104A1ACCA7F3B03 كلنت : local key = "F5" GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() T_WND = guiCreateWindow((screenW - 454) / 2, (screenH - 364) / 2, 454, 364, "~.* Player TAG - Panel *.~", false) guiWindowSetSizable(T_WND, false) guiSetProperty(T_WND, "CaptionColour", "FF29FF00") guiSetVisible(T_WND,false) GUIEditor.label[1] = guiCreateLabel(10, 29, 429, 17, "* Note : You can put Player serial and TAG Text for can show it in CHAT box", false, T_WND) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 255, 0, 0) GUIEditor.label[2] = guiCreateLabel(10, 67, 98, 16, "* Player serial :-", false, T_WND) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 47, 255, 0) T_Serial = guiCreateEdit(110, 67, 329, 18, "", false, T_WND) GUIEditor.label[3] = guiCreateLabel(10, 93, 98, 16, "* Player TAG :-", false, T_WND) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 5, 0, 255) T_TAG = guiCreateEdit(110, 91, 329, 18, "", false, T_WND) T_Enable = guiCreateButton(193, 123, 163, 28, "Enable TAG for Player", false, T_WND) guiSetFont(T_Enable, "default-bold-small") guiSetProperty(T_Enable, "NormalTextColour", "FFF6FF00") T_Close = guiCreateButton(356, 334, 88, 20, "Close", false, T_WND) guiSetFont(T_Close, "default-bold-small") guiSetProperty(T_Close, "NormalTextColour", "FFFF0000") GUIEditor.label[4] = guiCreateLabel(9, 334, 257, 20, "*~ By MR.GRAND", false, T_WND) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetColor(GUIEditor.label[4], 0, 234, 255) GUIEditor.label[5] = guiCreateLabel(434, 151, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetColor(GUIEditor.label[5], 38, 38, 38) GUIEditor.label[6] = guiCreateLabel(10, 147, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[6], "default-bold-small") guiLabelSetColor(GUIEditor.label[6], 38, 38, 38) function Show_Hide() if guiGetVisible(T_WND) == false then guiSetVisible(T_WND, true) showCursor(true) else guiSetVisible(T_WND, false) showCursor(false) end end bindKey(key,"down",Show_Hide) addEventHandler("onClientGUIClick",root, function () if source == T_Close then if(guiGetVisible(T_WND) == false)then end guiSetVisible(T_WND,false) showCursor(false) guiSetInputEnabled(false) end end) addEventHandler("onClientGUIClick",root, function () if source == T_Enable then local text = (guiGetText(T_Enable)) if ( text == "Enable TAG for Player" ) then guiSetText(T_Enable,"Disable TAG for player") TimerEnabled = setTimer ( guiSetText, 3000, 1, source, "Disable TAG for player" ) guiSetEnabled(source, false) setTimer(guiSetEnabled, 3000, 1, T_Enable, true) end local text = (guiGetText(T_Enable)) if ( text == "Disable TAG for player" ) then guiSetText(T_Enable,"Enable TAG for Player") guiSetEnabled(source, false) setTimer(guiSetEnabled, 3000, 1, T_Enable, true) end end end ) addEvent('GET',true) addEventHandler("GET",root, function () local COPY = guiGetText ( T_Serial ) end ) addEvent("TAG_GET",true) addEventHandler("TAG_GET",root, function () COPY = guiSetText ( T_TAG ,"LooooL") end) Link to comment
Naif Posted July 29, 2015 Share Posted July 29, 2015 @L000000L Mr.GRAND اخر شيء By Mr.GRAND Link to comment
MR.GRAND Posted July 29, 2015 Author Share Posted July 29, 2015 تبي الصراحة ؟ انا هو بس مسجل بنك ثاني ._. Link to comment
MR.GRAND Posted July 29, 2015 Author Share Posted July 29, 2015 الحين ابي حل للكود موب اسئلة Link to comment
terreus Posted July 29, 2015 Share Posted July 29, 2015 GUIEditor.label[4] = guiCreateLabel(9, 334, 257, 20, "*~ By MR.GRAND", false, T_WND) يخي متبطل ذذ حركات Link to comment
MR.GRAND Posted July 29, 2015 Author Share Posted July 29, 2015 محد يرد ؟ وش السالفة ؟ ردوو ياتابل ويا عناد ويا تنطيل ياكبااااااااار وينكم ؟ Link to comment
H25 Posted July 29, 2015 Share Posted July 29, 2015 أنت تبيه بالسيريال يعني لازم تحفظ التاج على السيريال طبعاً تقدر تستخدم اكثر من طريقة أنا أفضل تستخدم ملف xml للحفظ بس اذا ماتبيه يحفظ شي تقدر تستخدم جدول عادي Link to comment
H25 Posted July 29, 2015 Share Posted July 29, 2015 --Client local key = "F5" GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() T_WND = guiCreateWindow((screenW - 454) / 2, (screenH - 364) / 2, 454, 364, "~.* Player TAG - Panel *.~", false) guiWindowSetSizable(T_WND, false) guiSetProperty(T_WND, "CaptionColour", "FF29FF00") guiSetVisible(T_WND,false) GUIEditor.label[1] = guiCreateLabel(10, 29, 429, 17, "* Note : You can put Player serial and TAG Text for can show it in CHAT box", false, T_WND) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 255, 0, 0) GUIEditor.label[2] = guiCreateLabel(10, 67, 98, 16, "* Player serial :-", false, T_WND) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 47, 255, 0) T_Serial = guiCreateEdit(110, 67, 329, 18, "", false, T_WND) GUIEditor.label[3] = guiCreateLabel(10, 93, 98, 16, "* Player TAG :-", false, T_WND) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 5, 0, 255) T_TAG = guiCreateEdit(110, 91, 329, 18, "", false, T_WND) T_Enable = guiCreateButton(193, 123, 163, 28, "Enable TAG for Player", false, T_WND) guiSetFont(T_Enable, "default-bold-small") guiSetProperty(T_Enable, "NormalTextColour", "FFF6FF00") T_Close = guiCreateButton(356, 334, 88, 20, "Close", false, T_WND) guiSetFont(T_Close, "default-bold-small") guiSetProperty(T_Close, "NormalTextColour", "FFFF0000") GUIEditor.label[4] = guiCreateLabel(9, 334, 257, 20, "*~ By MR.GRAND", false, T_WND) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetColor(GUIEditor.label[4], 0, 234, 255) GUIEditor.label[5] = guiCreateLabel(434, 151, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetColor(GUIEditor.label[5], 38, 38, 38) GUIEditor.label[6] = guiCreateLabel(10, 147, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[6], "default-bold-small") guiLabelSetColor(GUIEditor.label[6], 38, 38, 38) --============================================-- function Show_Hide() if guiGetVisible(T_WND) == false then guiSetVisible(T_WND, true) showCursor(true) else guiSetVisible(T_WND, false) showCursor(false) end end bindKey(key, "down", Show_Hide) --============================================-- addEventHandler("onClientGUIClick", root, function () if (source == T_Close) then guiSetVisible(T_WND,false) showCursor(false) guiSetInputEnabled(false) elseif (source == T_Enable) then local text = guiGetText(source) if (text == "Enable TAG for Player") then guiSetText(T_Enable,"Disable TAG for player") local Serial = guiGetText(T_Serial) local Tag = guiGetText(T_TAG) triggerServerEvent("AddTagToXML", localPlayer, Serial, Tag) elseif (text == "Disable TAG for player") then guiSetText(T_Enable,"Enable TAG for Player") end guiSetEnabled(source, false) setTimer(guiSetEnabled, 3000, 1, T_Enable, true) end end ) -- Server addEventHandler('onResourceStart', resourceRoot, function () local TagsFile = xmlLoadFile("Tags.xml") if not TagsFile then TagsFile = xmlCreateFile("Tags.xml", "config") end xmlSaveFile(TagsFile) end ) --============================================-- addEvent("AddTagToXML",true) addEventHandler("TAG_GET", root, function (Serial, Tag) local TagsFile = xmlLoadFile("Tags.xml") TagChild = xmlCreateChild(TagsFile, "Tag") xmlNodeSetAttribute(TagChild, "Serial", Serial) xmlNodeSetAttribute(TagChild, "Tag", Tag) xmlSaveFile(TagsFile) end ) --============================================-- function isSerialHasTag (serial) local TagsFile = xmlLoadFile("Tags.xml") for i,tag in ipairs(xmlNodeGetChildren(TagsFile)) do if xmlNodeGetAttribute(tag, "Serial") == serial then return true end end return false end --============================================-- function getSerialTag (serial) local TagsFile = xmlLoadFile("Tags.xml") for i,tag in ipairs(xmlNodeGetChildren(TagsFile)) do if xmlNodeGetAttribute(tag, "Serial") == serial then return xmlNodeGetAttribute(tag, "Tag") end end return false end --============================================-- addEventHandler("onPlayerChat", root, function (text, msgtype) if isSerialHasTag(getPlayerSerial(source)) then cancelEvent() outputChatBox("#33FFCC=["..getSerialTag(getPlayerSerial(source)).."]= ["..getPlayerName(source).."]:#ffffff".. text, root, 255, 255, 255, true) end end ) ^ جرب ماجربته + هذا بس يضيف مايحذف يعني انت كمل الاكواد Link to comment
#DRAGON!FIRE Posted July 29, 2015 Share Posted July 29, 2015 كنت فاضي وسويته لكـ .. لم يتم التجربهـ .. : local key = "F5" local screenW, screenH = guiGetScreenSize() GUIEditor = { label = {} } T_WND = guiCreateWindow((screenW - 454) / 2, (screenH - 364) / 2, 454, 364, "~.* Player TAG - Panel *.~", false) guiWindowSetSizable(T_WND, false) guiSetProperty(T_WND, "CaptionColour", "FF29FF00") guiSetVisible(T_WND,false) GUIEditor.label[1] = guiCreateLabel(10, 29, 429, 17, "* Note : You can put Player serial and TAG Text for can show it in CHAT box", false, T_WND) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 255, 0, 0) GUIEditor.label[2] = guiCreateLabel(10, 67, 98, 16, "* Player serial :-", false, T_WND) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 47, 255, 0) T_Serial = guiCreateEdit(110, 67, 329, 18, "", false, T_WND) GUIEditor.label[3] = guiCreateLabel(10, 93, 98, 16, "* Player TAG :-", false, T_WND) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 5, 0, 255) T_TAG = guiCreateEdit(110, 91, 329, 18, "", false, T_WND) T_Enable = guiCreateButton(193, 123, 163, 28, "", false, T_WND) guiSetFont(T_Enable, "default-bold-small") guiSetProperty(T_Enable, "NormalTextColour", "FFF6FF00") T_Close = guiCreateButton(356, 334, 88, 20, "Close", false, T_WND) guiSetFont(T_Close, "default-bold-small") guiSetProperty(T_Close, "NormalTextColour", "FFFF0000") GUIEditor.label[4] = guiCreateLabel(9, 334, 257, 20, "2015", false, T_WND) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetColor(GUIEditor.label[4], 0, 234, 255) GUIEditor.label[5] = guiCreateLabel(434, 151, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetColor(GUIEditor.label[5], 38, 38, 38) GUIEditor.label[6] = guiCreateLabel(10, 147, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[6], "default-bold-small") guiLabelSetColor(GUIEditor.label[6], 38, 38, 38) bindKey ( key, "down", function( ) guiSetVisible ( T_WND, not guiGetVisible ( T_WND ) ) showCursor ( guiGetVisible ( T_WND ) ) end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == T_Close ) then guiSetVisible ( T_WND, false ) showCursor ( false ) elseif ( source == T_Enable ) then if ( string.len ( guiGetText ( T_Serial ) ) == 32 and string.len ( guiGetText ( T_TAG ) ) >= 3 ) then local player_ = getPlayerFromSerial ( guiGetText ( T_Serial ) ) if ( player_ ) then if ( guiGetText ( T_Enable ) == "Enable TAG for Player" ) then setElementData ( player_, "TagState", "Enable" ) setElementData ( player_, "playerTag", guiGetText ( T_TAG ) ) else setElementData ( player_, "TagState", "Disable" ) end end end end end ) addEventHandler ( "onClientGUIChanged", T_Serial, function ( ) local player_ = getPlayerFromSerial ( guiGetText ( source ) ) if ( player_ ) then if ( getElementData ( player_, "TagState" ) == "Enable" ) then guiSetText ( T_Enable, "Disable TAG for player" ) else guiSetText ( T_Enable, "Enable TAG for Player" ) end end end ) function getPlayerFromSerial ( serial ) assert ( type ( serial ) == "string" and #serial == 32, "getPlayerFromSerial - invalid serial" ) for index, player in ipairs ( getElementsByType ( "player" ) ) do if ( getPlayerSerial ( player ) == serial ) then return player end end return false end Link to comment
MR.GRAND Posted July 29, 2015 Author Share Posted July 29, 2015 --Client local key = "F5" GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() T_WND = guiCreateWindow((screenW - 454) / 2, (screenH - 364) / 2, 454, 364, "~.* Player TAG - Panel *.~", false) guiWindowSetSizable(T_WND, false) guiSetProperty(T_WND, "CaptionColour", "FF29FF00") guiSetVisible(T_WND,false) GUIEditor.label[1] = guiCreateLabel(10, 29, 429, 17, "* Note : You can put Player serial and TAG Text for can show it in CHAT box", false, T_WND) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 255, 0, 0) GUIEditor.label[2] = guiCreateLabel(10, 67, 98, 16, "* Player serial :-", false, T_WND) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 47, 255, 0) T_Serial = guiCreateEdit(110, 67, 329, 18, "", false, T_WND) GUIEditor.label[3] = guiCreateLabel(10, 93, 98, 16, "* Player TAG :-", false, T_WND) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 5, 0, 255) T_TAG = guiCreateEdit(110, 91, 329, 18, "", false, T_WND) T_Enable = guiCreateButton(193, 123, 163, 28, "Enable TAG for Player", false, T_WND) guiSetFont(T_Enable, "default-bold-small") guiSetProperty(T_Enable, "NormalTextColour", "FFF6FF00") T_Close = guiCreateButton(356, 334, 88, 20, "Close", false, T_WND) guiSetFont(T_Close, "default-bold-small") guiSetProperty(T_Close, "NormalTextColour", "FFFF0000") GUIEditor.label[4] = guiCreateLabel(9, 334, 257, 20, "*~ By MR.GRAND", false, T_WND) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetColor(GUIEditor.label[4], 0, 234, 255) GUIEditor.label[5] = guiCreateLabel(434, 151, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetColor(GUIEditor.label[5], 38, 38, 38) GUIEditor.label[6] = guiCreateLabel(10, 147, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[6], "default-bold-small") guiLabelSetColor(GUIEditor.label[6], 38, 38, 38) --============================================-- function Show_Hide() if guiGetVisible(T_WND) == false then guiSetVisible(T_WND, true) showCursor(true) else guiSetVisible(T_WND, false) showCursor(false) end end bindKey(key, "down", Show_Hide) --============================================-- addEventHandler("onClientGUIClick", root, function () if (source == T_Close) then guiSetVisible(T_WND,false) showCursor(false) guiSetInputEnabled(false) elseif (source == T_Enable) then local text = guiGetText(source) if (text == "Enable TAG for Player") then guiSetText(T_Enable,"Disable TAG for player") local Serial = guiGetText(T_Serial) local Tag = guiGetText(T_TAG) triggerServerEvent("AddTagToXML", localPlayer, Serial, Tag) elseif (text == "Disable TAG for player") then guiSetText(T_Enable,"Enable TAG for Player") end guiSetEnabled(source, false) setTimer(guiSetEnabled, 3000, 1, T_Enable, true) end end ) -- Server addEventHandler('onResourceStart', resourceRoot, function () local TagsFile = xmlLoadFile("Tags.xml") if not TagsFile then TagsFile = xmlCreateFile("Tags.xml", "config") end xmlSaveFile(TagsFile) end ) --============================================-- addEvent("AddTagToXML",true) addEventHandler("TAG_GET", root, function (Serial, Tag) local TagsFile = xmlLoadFile("Tags.xml") TagChild = xmlCreateChild(TagsFile, "Tag") xmlNodeSetAttribute(TagChild, "Serial", Serial) xmlNodeSetAttribute(TagChild, "Tag", Tag) xmlSaveFile(TagsFile) end ) --============================================-- function isSerialHasTag (serial) local TagsFile = xmlLoadFile("Tags.xml") for i,tag in ipairs(xmlNodeGetChildren(TagsFile)) do if xmlNodeGetAttribute(tag, "Serial") == serial then return true end end return false end --============================================-- function getSerialTag (serial) local TagsFile = xmlLoadFile("Tags.xml") for i,tag in ipairs(xmlNodeGetChildren(TagsFile)) do if xmlNodeGetAttribute(tag, "Serial") == serial then return xmlNodeGetAttribute(tag, "Tag") end end return false end --============================================-- addEventHandler("onPlayerChat", root, function (text, msgtype) if isSerialHasTag(getPlayerSerial(source)) then cancelEvent() outputChatBox("#33FFCC=["..getSerialTag(getPlayerSerial(source)).."]= ["..getPlayerName(source).."]:#ffffff".. text, root, 255, 255, 255, true) end end ) ^ جرب ماجربته + هذا بس يضيف مايحذف يعني انت كمل الاكواد بحط ملف الاكس ام ال بس لما احمله بالميتا وش احطه كونفق ولآ فايل ؟ Link to comment
MR.GRAND Posted July 29, 2015 Author Share Posted July 29, 2015 + ممابينحط السيريال والتاج بملف الاكس ام ال بمل بسويهم من السيرفر بتمنى تتأكد من الاكواد وتجربه Link to comment
#DRAGON!FIRE Posted July 29, 2015 Share Posted July 29, 2015 جرب كودي طبعا الكود ما يحفظ التاق .. ولو تبيه يحفظ قولي .. لكن اول شي جربه Link to comment
H25 Posted July 29, 2015 Share Posted July 29, 2015 --Client local key = "F5" GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() T_WND = guiCreateWindow((screenW - 454) / 2, (screenH - 364) / 2, 454, 364, "~.* Player TAG - Panel *.~", false) guiWindowSetSizable(T_WND, false) guiSetProperty(T_WND, "CaptionColour", "FF29FF00") guiSetVisible(T_WND,false) GUIEditor.label[1] = guiCreateLabel(10, 29, 429, 17, "* Note : You can put Player serial and TAG Text for can show it in CHAT box", false, T_WND) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 255, 0, 0) GUIEditor.label[2] = guiCreateLabel(10, 67, 98, 16, "* Player serial :-", false, T_WND) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 47, 255, 0) T_Serial = guiCreateEdit(110, 67, 329, 18, "", false, T_WND) GUIEditor.label[3] = guiCreateLabel(10, 93, 98, 16, "* Player TAG :-", false, T_WND) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 5, 0, 255) T_TAG = guiCreateEdit(110, 91, 329, 18, "", false, T_WND) T_Enable = guiCreateButton(193, 123, 163, 28, "Enable TAG for Player", false, T_WND) guiSetFont(T_Enable, "default-bold-small") guiSetProperty(T_Enable, "NormalTextColour", "FFF6FF00") T_Close = guiCreateButton(356, 334, 88, 20, "Close", false, T_WND) guiSetFont(T_Close, "default-bold-small") guiSetProperty(T_Close, "NormalTextColour", "FFFF0000") GUIEditor.label[4] = guiCreateLabel(9, 334, 257, 20, "*~ By MR.GRAND", false, T_WND) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetColor(GUIEditor.label[4], 0, 234, 255) GUIEditor.label[5] = guiCreateLabel(434, 151, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetColor(GUIEditor.label[5], 38, 38, 38) GUIEditor.label[6] = guiCreateLabel(10, 147, 15, 177, "||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||\n||", false, T_WND) guiSetFont(GUIEditor.label[6], "default-bold-small") guiLabelSetColor(GUIEditor.label[6], 38, 38, 38) --============================================-- function Show_Hide() if guiGetVisible(T_WND) == false then guiSetVisible(T_WND, true) showCursor(true) else guiSetVisible(T_WND, false) showCursor(false) end end bindKey(key, "down", Show_Hide) --============================================-- addEventHandler("onClientGUIClick", root, function () if (source == T_Close) then guiSetVisible(T_WND,false) showCursor(false) guiSetInputEnabled(false) elseif (source == T_Enable) then local text = guiGetText(source) if (text == "Enable TAG for Player") then guiSetText(T_Enable,"Disable TAG for player") local Serial = guiGetText(T_Serial) local Tag = guiGetText(T_TAG) triggerServerEvent("AddTagToXML", localPlayer, Serial, Tag) elseif (text == "Disable TAG for player") then guiSetText(T_Enable,"Enable TAG for Player") end guiSetEnabled(source, false) setTimer(guiSetEnabled, 3000, 1, T_Enable, true) end end ) -- Server addEventHandler('onResourceStart', resourceRoot, function () local TagsFile = xmlLoadFile("Tags.xml") if not TagsFile then TagsFile = xmlCreateFile("Tags.xml", "config") end xmlSaveFile(TagsFile) end ) --============================================-- addEvent("AddTagToXML",true) addEventHandler("TAG_GET", root, function (Serial, Tag) local TagsFile = xmlLoadFile("Tags.xml") TagChild = xmlCreateChild(TagsFile, "Tag") xmlNodeSetAttribute(TagChild, "Serial", Serial) xmlNodeSetAttribute(TagChild, "Tag", Tag) xmlSaveFile(TagsFile) end ) --============================================-- function isSerialHasTag (serial) local TagsFile = xmlLoadFile("Tags.xml") for i,tag in ipairs(xmlNodeGetChildren(TagsFile)) do if xmlNodeGetAttribute(tag, "Serial") == serial then return true end end return false end --============================================-- function getSerialTag (serial) local TagsFile = xmlLoadFile("Tags.xml") for i,tag in ipairs(xmlNodeGetChildren(TagsFile)) do if xmlNodeGetAttribute(tag, "Serial") == serial then return xmlNodeGetAttribute(tag, "Tag") end end return false end --============================================-- addEventHandler("onPlayerChat", root, function (text, msgtype) if isSerialHasTag(getPlayerSerial(source)) then cancelEvent() outputChatBox("#33FFCC=["..getSerialTag(getPlayerSerial(source)).."]= ["..getPlayerName(source).."]:#ffffff".. text, root, 255, 255, 255, true) 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