MR.GRAND Posted July 29, 2015 Author Share Posted July 29, 2015 بس الملف لما بينزل في المودات المحملة بيبقى بس كود كونفق ومابينزل فيه اي شي حتى لو حطيت سيريال الاعب ولتاج وضغطت Enable 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
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
MR.GRAND Posted July 30, 2015 Author Share Posted July 30, 2015 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 30, 2015 Share Posted July 30, 2015 انت استخدمت كودي ولا كودهـ Link to comment
MR.GRAND Posted July 30, 2015 Author Share Posted July 30, 2015 كودك جربته وحطيت في اول فراغ بالسيرفر سيريال والثاني التاج وماظبط + Link to comment
#DRAGON!FIRE Posted July 30, 2015 Share Posted July 30, 2015 ترا ما سويت لكـ حدث يوم يتكلم بالشات قلت انت تسويه لو عندك السكربت حق التاج ادمن او كذا لكن ضيف هالكود بسيرفر وجرب : addEventHandler ( "onPlayerChat", root, function ( msg ) if ( getElementData ( source, "TagState" ) ~= "Enable" ) then return end cancelEvent ( ) outputChatBox (" ( "..getElementData ( source, "playerTag" ).." ) "..getPlayerName ( source )..": #FFFFFF"..msg, root, 255, 255, 255, true ) end ) Link to comment
MR.GRAND Posted July 30, 2015 Author Share Posted July 30, 2015 ترا ما سويت لكـ حدث يوم يتكلم بالشات قلت انت تسويه لو عندك السكربت حق التاج ادمن او كذالكن ضيف هالكود بسيرفر وجرب : addEventHandler ( "onPlayerChat", root, function ( msg ) if ( getElementData ( source, "TagState" ) ~= "Enable" ) then return end cancelEvent ( ) outputChatBox (" ( "..getElementData ( source, "playerTag" ).." ) "..getPlayerName ( source )..": #FFFFFF"..msg, root, 255, 255, 255, true ) end ) حطيت بالسيرفر سايد صار كذا 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 ( msg ) addEventHandler("onPlayerChat", root, function (text, msgtype) if ( getElementData ( source, "TagState" ) ~= "Enable" ) then return end cancelEvent ( ) outputChatBox (" ( "..getElementData ( source, "playerTag" ).." ) "..getPlayerName ( source )..": #FFFFFF"..text, root, 255, 255, 255, true ) end ) كمان لما احط السيريال والتاج بالايديت بوكسات واضغط اينيبل مايجي التاج Link to comment
Naif Posted July 30, 2015 Share Posted July 30, 2015 تم جربت كود زاحف 100% ظابط وكل شيء Link to comment
#DRAGON!FIRE Posted July 30, 2015 Share Posted July 30, 2015 انسخ الكود مرهـ ثانية .. لان عدلت فيه شي بسيط + شيل الاكواد القديمة Link to comment
MR.GRAND Posted July 30, 2015 Author Share Posted July 30, 2015 يعني لما بتحط السيريال بأول إيديت والتاج بالثاني وتظغط االزر يظبط ؟ Link to comment
#DRAGON!FIRE Posted July 30, 2015 Share Posted July 30, 2015 الرجال قال اشتغل .. يعني شغال .. وانا ما اشوف اخطاء لكن انت انسخ الكود مره ثانية حق الشات .. وشيل الاكواد القديمة كلها . Link to comment
MR.GRAND Posted July 30, 2015 Author Share Posted July 30, 2015 ممكن تحط الكود اللي انسخخه كله واحطه بالكلنت واشغله وخلآص ؟ Link to comment
Naif Posted July 30, 2015 Share Posted July 30, 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 سيرفر addEventHandler ( "onPlayerChat", root, function ( text ) if ( getElementData ( source, "TagState" ) ~= "Enable" ) then return end cancelEvent ( ) outputChatBox (" ( "..getElementData ( source, "playerTag" ).." ) "..getPlayerName ( source )..": #FFFFFF"..text, root, 255, 255, 255, true ) end ) Link to comment
#DRAGON!FIRE Posted July 30, 2015 Share Posted July 30, 2015 ملاحظة نسيت اقولها .. التاج لازم يكون اكثر 3 احرف واكثر .. Client Side ! 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 Server Side ! addEventHandler ( "onPlayerChat", root, function ( msg ) if ( getElementData ( source, "TagState" ) ~= "Enable" ) then return end cancelEvent ( ) outputChatBox (" ( "..getElementData ( source, "playerTag" ).." ) "..getPlayerName ( source )..": #FFFFFF"..msg, root, 255, 255, 255, true ) end ) Link to comment
MR.GRAND Posted July 30, 2015 Author Share Posted July 30, 2015 بقت إأآخر شغلة # لو ابي احفظه بالداتا كيف ؟ يعني لما بيخرج اللاعب وبيدخل يبقى التاج على سيرياله بينحفظ وبقدر أحط سيريال اي لاعب واظبط له التاج ولآ بس لنفسي ؟ أتمنى الرد مع خاصية إزالة التاج عند ضغط Disable Tag وبكون شاكر لك ي زاحف :] Link to comment
#DRAGON!FIRE Posted July 30, 2015 Share Posted July 30, 2015 (edited) بالنسبة للسريال .. اكيد يشتغل لاي احد .. وبالنسبة لتعطيل التاج انا مسويه لك زي كذا جربه انت Client Side ! 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 setSerialData ( guiGetText ( T_Serial ), "TagState", "Enable" ) setSerialData ( guiGetText ( T_Serial ), "playerTag", guiGetText ( T_TAG ) ) guiSetText ( T_Enable, "Disable TAG for Player" ) else guiSetText ( T_Enable, "Enable TAG for Player" ) setSerialData ( guiGetText ( T_Serial ), "TagState", "Disable" ) end end end end end ) addEventHandler ( "onClientGUIChanged", T_Serial, function ( ) local player_ = getPlayerFromSerial ( guiGetText ( source ) ) if ( player_ ) then if ( getSerialData ( guiGetText ( source ), "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 function setSerialData(serial,key,value) if( value and type(serial) == "string") then setElementData(root,serial.."&"..key,value) end end function getSerialData(serial,key) if ( key and type(serial) == "string") then value = getElementData(root,serial.."&"..key) end return value end Server Side ! addEventHandler ( "onPlayerChat", root, function ( msg ) if ( getSerialData ( getPlayerSerial ( source ), "TagState" ) ~= "Enable" ) then return end cancelEvent ( ) outputChatBox (" ( "..getSerialData ( getPlayerSerial ( source ), "playerTag" ).." ) "..getPlayerName ( source )..": #FFFFFF"..msg, root, 255, 255, 255, true ) end ) function getSerialData(serial,key) if ( key and type(serial) == "string") then value = getElementData(root,serial.."&"..key) end return value end Edited July 30, 2015 by Guest Link to comment
H25 Posted July 30, 2015 Share Posted July 30, 2015 ^ شلون في فنكشن setSerialData انت حاط اول ارقمنت يحط السيريال وفي الاستخدام تحط اللاعب ؟ ونفس الشي getSerialData Link to comment
MR.GRAND Posted July 30, 2015 Author Share Posted July 30, 2015 لما اسوي الخطوات مايجي التاج بالشات ._. فيه خطأ ؟ Link to comment
MR.GRAND Posted July 30, 2015 Author Share Posted July 30, 2015 مابقا إلآ رد واحد من زاحف ويكون متأكد من الكود ويغلقق :# Link to comment
#DRAGON!FIRE Posted July 30, 2015 Share Posted July 30, 2015 ^شلون في فنكشن setSerialData انت حاط اول ارقمنت يحط السيريال وفي الاستخدام تحط اللاعب ؟ ونفس الشي getSerialData يب صحيح نسيت استبدلهم الى سيريال اللاعب .. تم التعديل انسخ الكود مرهـ ثانية Link to comment
MR.GRAND Posted July 30, 2015 Author Share Posted July 30, 2015 ^شلون في فنكشن setSerialData انت حاط اول ارقمنت يحط السيريال وفي الاستخدام تحط اللاعب ؟ ونفس الشي getSerialData يب صحيح نسيت استبدلهم الى سيريال اللاعب .. تم التعديل انسخ الكود مرهـ ثانية حطيت ذا اللي انت مسويه 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 setSerialData ( T_Serial, "TagState", "Enable" ) setSerialData ( T_Serial, "playerTag", guiGetText ( T_TAG ) ) guiSetText ( T_Enable, "Disable TAG for Player" ) else guiSetText ( T_Enable, "Enable TAG for Player" ) setSerialData ( T_Serial, "TagState", "Disable" ) end end end end end ) addEventHandler ( "onClientGUIChanged", T_Serial, function ( ) local player_ = getPlayerFromSerial ( guiGetText ( source ) ) if ( player_ ) then if ( getSerialData ( guiGetText ( source ), "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 function setSerialData(serial,key,value) if( value and type(serial) == "string") then setElementData(root,serial.."&"..key,value) end end function getSerialData(serial,key) if ( key and type(serial) == "string") then value = getElementData(root,serial.."&"..key) end return value end سيرفر : addEventHandler ( "onPlayerChat", root, function ( msg ) if ( getSerialData ( getPlayerSerial ( source ), "TagState" ) ~= "Enable" ) then return end cancelEvent ( ) outputChatBox (" ( "..getSerialData ( getPlayerSerial ( source ), "playerTag" ).." ) "..getPlayerName ( source )..": #FFFFFF"..msg, root, 255, 255, 255, true ) end ) function getSerialData(serial,key) if ( key and type(serial) == "string") then value = getElementData(root,serial.."&"..key) end return value 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