SaedAmer Posted June 14, 2016 Author Share Posted June 14, 2016 ضض لاحد يضحك انا استحي اطرح موضوع في قسم البرمجه خاصه ما اطرح الا بعد ما اطفش ويقفل عقلي استنفذ كامل قويا العقليه اما المودات اطلب مود اذا كنت مستعجل ماني فاضي اسويه مب فاهم شئ Link to comment
iMr.WiFi..! Posted June 15, 2016 Share Posted June 15, 2016 يخوي مافي كود يلغي ال unmute لازم تروح الاسل Link to comment
SaedAmer Posted June 15, 2016 Author Share Posted June 15, 2016 يخوي مافي كود يلغي ال unmuteلازم تروح الاسل يا اخي والله عملتها بالسل و ما شتغلت Link to comment
Jupi Posted June 15, 2016 Share Posted June 15, 2016 ^ ممكن تفهمني يبي يتعلم ايش بالضبط؟ اذا عطيناه فنكشنات يقول مافهمت, نقول له شوف المثال يقول ما فهمت يعني واضحه يبي كود جاهز هو و لعبة ذا لو يتعلمون من اللي ياخذوه يصيرون افضل مني منك Link to comment
Me[Z]oO Posted June 15, 2016 Share Posted June 15, 2016 (edited) Groups = { "Level 2", "Level 3", "Level 4", "Level 5", } addEventHandler ( "onPlayerUnmute", root, function() local account = getAccountName ( getPlayerAccount ( source ) ) for i,g in ipairs (Groups) do if isObjectInACLGroup ( "user." ..account , aclGetGroup ( g ) ) then cancelEvent() break end end end ) Edited June 15, 2016 by Guest Link to comment
Abdul KariM Posted June 15, 2016 Share Posted June 15, 2016 Groups = { "Level 2", "Level 3", "Level 4", "Level 5", } addEventHandler ( "onPlayerUnmute", root, function() local account = getPlayerAccount(source) for i,g in ipairs (Groups) do if isObjectInACLGroup ( "user." ..account , aclGetGroup ( g ) ) then cancelEvent() break end end end ) خلاص يا شباب هو م يبي يتعلم اعطوه جاهز وخلاص فيه غلط المفروض بسطر 12 تحط اسم الحساب ماتحط الحساب getAccountName Link to comment
Me[Z]oO Posted June 15, 2016 Share Posted June 15, 2016 شكرا م انتبهت لها رمضان كريم , Link to comment
Abdul KariM Posted June 15, 2016 Share Posted June 15, 2016 Groups = { "Level 2", "Level 3", "Level 4", "Level 5", } addEventHandler ( "onPlayerUnmute", root, function() local account = getAccountName (source) for i,g in ipairs (Groups) do if isObjectInACLGroup ( "user." ..account , aclGetGroup ( g ) ) then cancelEvent() break end end end ) خلاص يا شباب هو م يبي يتعلم اعطوه جاهز وخلاص وبعد غلط , string getAccountName ( account theAccount ) يقولك الارقمنت تحط الحساب الي تبي تجيب اسمه انت حطيت سورس , راح يجي باد ارقمنت getAccountName ( getPlayerAccount ( source ) ) Link to comment
SaedAmer Posted June 15, 2016 Author Share Posted June 15, 2016 اخر تصحيح للكود ايه ؟ Link to comment
iMr.WiFi..! Posted June 15, 2016 Share Posted June 15, 2016 الكود مابينفعش ابداً لانه يالحلو بيتحقق انه لاعب الي انفك منه ميوت هو من رتب ذيكك من ثم يكنسل يعني انه ماينفك الميوت لل فوق لفل 1 هذا مو طلبك _ لازم تعدل الاسل Link to comment
SaedAmer Posted June 15, 2016 Author Share Posted June 15, 2016 الكود مابينفعش ابداًلانه يالحلو بيتحقق انه لاعب الي انفك منه ميوت هو من رتب ذيكك من ثم يكنسل يعني انه ماينفك الميوت لل فوق لفل 1 هذا مو طلبك _ لازم تعدل الاسل طيب جرب انت تعدل اسل السيرفر التجريبي و جرب عشان تصدق Link to comment
Me[Z]oO Posted June 15, 2016 Share Posted June 15, 2016 Groups = { "Level 2", "Level 3", "Level 4", "Level 5", } addEventHandler ( "onPlayerUnmute", root, function() local account = getAccountName ( getPlayerAccount ( source ) ) for i,g in ipairs (Groups) do if isObjectInACLGroup ( "user." ..account , aclGetGroup ( g ) ) then cancelEvent() break end end end ) Link to comment
iMr.SFA7 Posted June 15, 2016 Share Posted June 15, 2016 @Ma[Z]en: كودك هذا راح يتحقق من أن اللاعب الي انصك ميوت في أحد القروبات الي بالجدول واذا موجود بيفك ميوتـه وصاحـب الموضـوع يبـي محد لفل1 ما يفك الميوت بس يقدر يصك @SaedAmer: أنت ماتقدر تسمح لقروب أنه يصك ميوت بس ما يفكه لأن الأدمنية نظامهـا كـذا فـ عـدل ع الأدمـنيـة Link to comment
N3xT Posted June 15, 2016 Share Posted June 15, 2016 أستبدل ملف أدمن سيرفر بالأكواد ذي وسطر 25 تحط الرتب اللي تبيها تفك الميوت --[[********************************** * * Multi Theft Auto - Admin Panel * * admin_server.lua * * Original File by lil_Toady * **************************************]] _root = getRootElement() _types = { "player", "team", "vehicle", "resource", "bans", "server", "admin" } _settings = nil aPlayers = {} aLogMessages = {} aInteriors = {} aStats = {} aReports = {} aWeathers = {} aNickChangeTime = {} local aUnmuteTimerList = {} Groups = { "Admin", } function notifyPlayerLoggedIn(player) outputChatBox ( "Press 'p' to open your admin panel", player ) local unread = 0 for _, msg in ipairs ( aReports ) do unread = unread + ( msg.read and 0 or 1 ) end if unread > 0 then outputChatBox( unread .. " unread Admin message" .. ( unread==1 and "" or "s" ), player, 255, 0, 0 ) end end addEventHandler ( "onResourceStart", _root, function ( resource ) if ( resource ~= getThisResource() ) then for id, player in ipairs(getElementsByType("player")) do if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then triggerClientEvent ( player, "aClientResourceStart", _root, getResourceName ( resource ) ) end end return end _settings = xmlLoadFile ( "conf\\settings.xml" ) if ( not _settings ) then _settings = xmlCreateFile ( "conf\\settings.xml", "main" ) xmlSaveFile ( _settings ) end aSetupACL() aSetupCommands() for id, player in ipairs ( getElementsByType ( "player" ) ) do aPlayerInitialize ( player ) if ( hasObjectPermissionTo ( player, "general.adminpanel" ) ) then notifyPlayerLoggedIn(player) end end local node = xmlLoadFile ( "conf\\interiors.xml" ) if ( node ) then local interiors = 0 while ( xmlFindChild ( node, "interior", interiors ) ) do local interior = xmlFindChild ( node, "interior", interiors ) interiors = interiors + 1 aInteriors[interiors] = {} aInteriors[interiors]["world"] = tonumber ( xmlNodeGetAttribute ( interior, "world" ) ) aInteriors[interiors]["id"] = xmlNodeGetAttribute ( interior, "id" ) aInteriors[interiors]["x"] = xmlNodeGetAttribute ( interior, "posX" ) aInteriors[interiors]["y"] = xmlNodeGetAttribute ( interior, "posY" ) aInteriors[interiors]["z"] = xmlNodeGetAttribute ( interior, "posZ" ) aInteriors[interiors]["r"] = xmlNodeGetAttribute ( interior, "rot" ) end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\stats.xml" ) if ( node ) then local stats = 0 while ( xmlFindChild ( node, "stat", stats ) ) do local stat = xmlFindChild ( node, "stat", stats ) local id = tonumber ( xmlNodeGetAttribute ( stat, "id" ) ) local name = xmlNodeGetAttribute ( stat, "name" ) aStats[id] = name stats = stats + 1 end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\weathers.xml" ) if ( node ) then local weathers = 0 while ( xmlFindChild ( node, "weather", weathers ) ~= false ) do local weather = xmlFindChild ( node, "weather", weathers ) local id = tonumber ( xmlNodeGetAttribute ( weather, "id" ) ) local name = xmlNodeGetAttribute ( weather, "name" ) aWeathers[id] = name weathers = weathers + 1 end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\reports.xml" ) if ( node ) then local messages = 0 while ( xmlFindChild ( node, "message", messages ) ) do subnode = xmlFindChild ( node, "message", messages ) local author = xmlFindChild ( subnode, "author", 0 ) local subject = xmlFindChild ( subnode, "subject", 0 ) local category = xmlFindChild ( subnode, "category", 0 ) local text = xmlFindChild ( subnode, "text", 0 ) local time = xmlFindChild ( subnode, "time", 0 ) local read = ( xmlFindChild ( subnode, "read", 0 ) ~= false ) local id = #aReports + 1 aReports[id] = {} if ( author ) then aReports[id].author = xmlNodeGetValue ( author ) else aReports[id].author = "" end if ( category ) then aReports[id].category = xmlNodeGetValue ( category ) else aReports[id].category = "" end if ( subject ) then aReports[id].subject = xmlNodeGetValue ( subject ) else aReports[id].subject = "" end if ( text ) then aReports[id].text = xmlNodeGetValue ( text ) else aReports[id].text = "" end if ( time ) then aReports[id].time = xmlNodeGetValue ( time ) else aReports[id].time = "" end aReports[id].read = read messages = messages + 1 end -- Remove duplicates local a = 1 while a <= #aReports do local b = a + 1 while b <= #aReports do if table.cmp( aReports[a], aReports[b] ) then table.remove( aReports, b ) b = b - 1 end b = b + 1 end a = a + 1 end -- Upgrade time from '4/9 5:9' to '2009-09-04 05:09' for id, rep in ipairs ( aReports ) do if string.find( rep.time, "/" ) then local monthday, month, hour, minute = string.match( rep.time, "^(.-)/(.-) (.-).-)$" ) rep.time = string.format( '%04d-%02d-%02d %02d:%02d', 2009, month + 1, monthday, hour, minute ) end end -- Sort messages by time table.sort(aReports, function(a,b) return(a.time < b.time) end) -- Limit number of messages while #aReports > g_Prefs.maxmsgs do table.remove( aReports, 1 ) end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\messages.xml" ) if ( node ) then for id, type in ipairs ( _types ) do local subnode = xmlFindChild ( node, type, 0 ) if ( subnode ) then aLogMessages[type] = {} local groups = 0 while ( xmlFindChild ( subnode, "group", groups ) ) do local group = xmlFindChild ( subnode, "group", groups ) local action = xmlNodeGetAttribute ( group, "action" ) local r = tonumber ( xmlNodeGetAttribute ( group, "r" ) ) local g = tonumber ( xmlNodeGetAttribute ( group, "g" ) ) local b = tonumber ( xmlNodeGetAttribute ( group, "b" ) ) aLogMessages[type][action] = {} aLogMessages[type][action]["r"] = r or 0 aLogMessages[type][action]["g"] = g or 255 aLogMessages[type][action]["b"] = b or 0 if ( xmlFindChild ( group, "all", 0 ) ) then aLogMessages[type][action]["all"] = xmlNodeGetValue ( xmlFindChild ( group, "all", 0 ) ) end if ( xmlFindChild ( group, "admin", 0 ) ) then aLogMessages[type][action]["admin"] = xmlNodeGetValue ( xmlFindChild ( group, "admin", 0 ) ) end if ( xmlFindChild ( group, "player", 0 ) ) then aLogMessages[type][action]["player"] = xmlNodeGetValue ( xmlFindChild ( group, "player", 0 ) ) end if ( xmlFindChild ( group, "log", 0 ) ) then aLogMessages[type][action]["log"] = xmlNodeGetValue ( xmlFindChild ( group, "log", 0 ) ) end groups = groups + 1 end end end xmlUnloadFile ( node ) end end ) addEventHandler ( "onResourceStop", _root, function ( resource ) -- Incase the resource being stopped has been deleted local stillExists = false for i, res in ipairs(getResources()) do if res == resource then stillExists = true break end end if not stillExists then return end if ( resource ~= getThisResource() ) then for id, player in ipairs(getElementsByType("player")) do if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then triggerClientEvent ( player, "aClientResourceStop", _root, getResourceName ( resource ) ) end end else local node = xmlLoadFile ( "conf\\reports.xml" ) if ( node ) then while ( xmlFindChild ( node, "message", 0 ) ~= false ) do local subnode = xmlFindChild ( node, "message", 0 ) xmlDestroyNode ( subnode ) end else node = xmlCreateFile ( "conf\\reports.xml", "messages" ) end for id, message in ipairs ( aReports ) do local subnode = xmlCreateChild ( node, "message" ) for key, value in pairs ( message ) do if ( value ) then xmlNodeSetValue ( xmlCreateChild ( subnode, key ), tostring ( value ) ) end end end xmlSaveFile ( node ) xmlUnloadFile ( node ) -- Unmute anybody muted by admin for i, player in ipairs(getElementsByType("player")) do local serial = getPlayerSerial( player ) if (aUnmuteTimerList[serial]) then aUnmuteTimerList[serial] = nil setPlayerMuted(player, false) end end end aclSave () end ) function aGetSetting ( setting ) local result = xmlFindChild ( _settings, tostring ( setting ), 0 ) if ( result ) then result = xmlNodeGetValue ( result ) if ( result == "true" ) then return true elseif ( result == "false" ) then return false else return result end end return false end function aSetSetting ( setting, value ) local node = xmlFindChild ( _settings, tostring ( setting ), 0 ) if ( not node ) then node = xmlCreateChild ( _settings, tostring ( setting ) ) end Link to comment
Me[Z]oO Posted June 15, 2016 Share Posted June 15, 2016 @Ma[Z]en: كودك هذا راح يتحقق من أن اللاعب الي انصك ميوت في أحد القروبات الي بالجدول واذا موجود بيفك ميوتـه وصاحـب الموضـوع يبـي محد لفل1 ما يفك الميوت بس يقدر يصك@SaedAmer: أنت ماتقدر تسمح لقروب أنه يصك ميوت بس ما يفكه لأن الأدمنية نظامهـا كـذا فـ عـدل ع الأدمـنيـة انا فهمت انه يبي لما احد يتفك ميوته بالقروبات ذي يكنسل الايفنت ذا طلبه ! Link to comment
iMr.SFA7 Posted June 15, 2016 Share Posted June 15, 2016 @Ma[Z]en: كودك هذا راح يتحقق من أن اللاعب الي انصك ميوت في أحد القروبات الي بالجدول واذا موجود بيفك ميوتـه وصاحـب الموضـوع يبـي محد لفل1 ما يفك الميوت بس يقدر يصك@SaedAmer: أنت ماتقدر تسمح لقروب أنه يصك ميوت بس ما يفكه لأن الأدمنية نظامهـا كـذا فـ عـدل ع الأدمـنيـة انا فهمت انه يبي لما احد يتفك ميوته بالقروبات ذي يكنسل الايفنت ذا طلبه ! هذا هو الموضـوع السلام عليكمانا عاوز لفل 1 يصك ميوت بس ما يقدر يفكه جربت اعملها في الاسل ما نفعت قعـدت أقـلب من هنا وهنا مالقيت أنه يبي لما أحد ينفك ميوته بالقروبات ذي يكنسل الايفنت Link to comment
Me[Z]oO Posted June 15, 2016 Share Posted June 15, 2016 كده صح ؟ addEventHandler ( "onPlayerUnmute", root, cancelEvent ( ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Level 1","Level 2","Level 3","Level 4","Level 5" ) ) then انا لقيته سوا كذا فـ فهمت طلبه وصلحت له الكود Link to comment
SaedAmer Posted June 16, 2016 Author Share Posted June 16, 2016 أستبدل ملف أدمن سيرفر بالأكواد ذي وسطر 25 تحط الرتب اللي تبيها تفك الميوت --[[********************************** * * Multi Theft Auto - Admin Panel * * admin_server.lua * * Original File by lil_Toady * **************************************]] _root = getRootElement() _types = { "player", "team", "vehicle", "resource", "bans", "server", "admin" } _settings = nil aPlayers = {} aLogMessages = {} aInteriors = {} aStats = {} aReports = {} aWeathers = {} aNickChangeTime = {} local aUnmuteTimerList = {} Groups = { "Admin", } function notifyPlayerLoggedIn(player) outputChatBox ( "Press 'p' to open your admin panel", player ) local unread = 0 for _, msg in ipairs ( aReports ) do unread = unread + ( msg.read and 0 or 1 ) end if unread > 0 then outputChatBox( unread .. " unread Admin message" .. ( unread==1 and "" or "s" ), player, 255, 0, 0 ) end end addEventHandler ( "onResourceStart", _root, function ( resource ) if ( resource ~= getThisResource() ) then for id, player in ipairs(getElementsByType("player")) do if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then triggerClientEvent ( player, "aClientResourceStart", _root, getResourceName ( resource ) ) end end return end _settings = xmlLoadFile ( "conf\\settings.xml" ) if ( not _settings ) then _settings = xmlCreateFile ( "conf\\settings.xml", "main" ) xmlSaveFile ( _settings ) end aSetupACL() aSetupCommands() for id, player in ipairs ( getElementsByType ( "player" ) ) do aPlayerInitialize ( player ) if ( hasObjectPermissionTo ( player, "general.adminpanel" ) ) then notifyPlayerLoggedIn(player) end end local node = xmlLoadFile ( "conf\\interiors.xml" ) if ( node ) then local interiors = 0 while ( xmlFindChild ( node, "interior", interiors ) ) do local interior = xmlFindChild ( node, "interior", interiors ) interiors = interiors + 1 aInteriors[interiors] = {} aInteriors[interiors]["world"] = tonumber ( xmlNodeGetAttribute ( interior, "world" ) ) aInteriors[interiors]["id"] = xmlNodeGetAttribute ( interior, "id" ) aInteriors[interiors]["x"] = xmlNodeGetAttribute ( interior, "posX" ) aInteriors[interiors]["y"] = xmlNodeGetAttribute ( interior, "posY" ) aInteriors[interiors]["z"] = xmlNodeGetAttribute ( interior, "posZ" ) aInteriors[interiors]["r"] = xmlNodeGetAttribute ( interior, "rot" ) end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\stats.xml" ) if ( node ) then local stats = 0 while ( xmlFindChild ( node, "stat", stats ) ) do local stat = xmlFindChild ( node, "stat", stats ) local id = tonumber ( xmlNodeGetAttribute ( stat, "id" ) ) local name = xmlNodeGetAttribute ( stat, "name" ) aStats[id] = name stats = stats + 1 end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\weathers.xml" ) if ( node ) then local weathers = 0 while ( xmlFindChild ( node, "weather", weathers ) ~= false ) do local weather = xmlFindChild ( node, "weather", weathers ) local id = tonumber ( xmlNodeGetAttribute ( weather, "id" ) ) local name = xmlNodeGetAttribute ( weather, "name" ) aWeathers[id] = name weathers = weathers + 1 end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\reports.xml" ) if ( node ) then local messages = 0 while ( xmlFindChild ( node, "message", messages ) ) do subnode = xmlFindChild ( node, "message", messages ) local author = xmlFindChild ( subnode, "author", 0 ) local subject = xmlFindChild ( subnode, "subject", 0 ) local category = xmlFindChild ( subnode, "category", 0 ) local text = xmlFindChild ( subnode, "text", 0 ) local time = xmlFindChild ( subnode, "time", 0 ) local read = ( xmlFindChild ( subnode, "read", 0 ) ~= false ) local id = #aReports + 1 aReports[id] = {} if ( author ) then aReports[id].author = xmlNodeGetValue ( author ) else aReports[id].author = "" end if ( category ) then aReports[id].category = xmlNodeGetValue ( category ) else aReports[id].category = "" end if ( subject ) then aReports[id].subject = xmlNodeGetValue ( subject ) else aReports[id].subject = "" end if ( text ) then aReports[id].text = xmlNodeGetValue ( text ) else aReports[id].text = "" end if ( time ) then aReports[id].time = xmlNodeGetValue ( time ) else aReports[id].time = "" end aReports[id].read = read messages = messages + 1 end -- Remove duplicates local a = 1 while a <= #aReports do local b = a + 1 while b <= #aReports do if table.cmp( aReports[a], aReports[b] ) then table.remove( aReports, b ) b = b - 1 end b = b + 1 end a = a + 1 end -- Upgrade time from '4/9 5:9' to '2009-09-04 05:09' for id, rep in ipairs ( aReports ) do if string.find( rep.time, "/" ) then local monthday, month, hour, minute = string.match( rep.time, "^(.-)/(.-) (.-).-)$" ) rep.time = string.format( '%04d-%02d-%02d %02d:%02d', 2009, month + 1, monthday, hour, minute ) end end -- Sort messages by time table.sort(aReports, function(a,b) return(a.time < b.time) end) -- Limit number of messages while #aReports > g_Prefs.maxmsgs do table.remove( aReports, 1 ) end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\messages.xml" ) if ( node ) then for id, type in ipairs ( _types ) do local subnode = xmlFindChild ( node, type, 0 ) if ( subnode ) then aLogMessages[type] = {} local groups = 0 while ( xmlFindChild ( subnode, "group", groups ) ) do local group = xmlFindChild ( subnode, "group", groups ) local action = xmlNodeGetAttribute ( group, "action" ) local r = tonumber ( xmlNodeGetAttribute ( group, "r" ) ) local g = tonumber ( xmlNodeGetAttribute ( group, "g" ) ) local b = tonumber ( xmlNodeGetAttribute ( group, "b" ) ) aLogMessages[type][action] = {} aLogMessages[type][action]["r"] = r or 0 aLogMessages[type][action]["g"] = g or 255 aLogMessages[type][action]["b"] = b or 0 if ( xmlFindChild ( group, "all", 0 ) ) then aLogMessages[type][action]["all"] = xmlNodeGetValue ( xmlFindChild ( group, "all", 0 ) ) end if ( xmlFindChild ( group, "admin", 0 ) ) then aLogMessages[type][action]["admin"] = xmlNodeGetValue ( xmlFindChild ( group, "admin", 0 ) ) end if ( xmlFindChild ( group, "player", 0 ) ) then aLogMessages[type][action]["player"] = xmlNodeGetValue ( xmlFindChild ( group, "player", 0 ) ) end if ( xmlFindChild ( group, "log", 0 ) ) then aLogMessages[type][action]["log"] = xmlNodeGetValue ( xmlFindChild ( group, "log", 0 ) ) end groups = groups + 1 end end end xmlUnloadFile ( node ) end end ) addEventHandler ( "onResourceStop", _root, function ( resource ) -- Incase the resource being stopped has been deleted local stillExists = false for i, res in ipairs(getResources()) do if res == resource then stillExists = true break end end if not stillExists then return end if ( resource ~= getThisResource() ) then for id, player in ipairs(getElementsByType("player")) do if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then triggerClientEvent ( player, "aClientResourceStop", _root, getResourceName ( resource ) ) end end else local node = xmlLoadFile ( "conf\\reports.xml" ) if ( node ) then while ( xmlFindChild ( node, "message", 0 ) ~= false ) do local subnode = xmlFindChild ( node, "message", 0 ) xmlDestroyNode ( subnode ) end else node = xmlCreateFile ( "conf\\reports.xml", "messages" ) end for id, message in ipairs ( aReports ) do local subnode = xmlCreateChild ( node, "message" ) for key, value in pairs ( message ) do if ( value ) then xmlNodeSetValue ( xmlCreateChild ( subnode, key ), tostring ( value ) ) end end end xmlSaveFile ( node ) xmlUnloadFile ( node ) -- Unmute anybody muted by admin for i, player in ipairs(getElementsByType("player")) do local serial = getPlayerSerial( player ) if (aUnmuteTimerList[serial]) then aUnmuteTimerList[serial] = nil setPlayerMuted(player, false) end end end aclSave () end ) function aGetSetting ( setting ) local result = xmlFindChild ( _settings, tostring ( setting ), 0 ) if ( result ) then result = xmlNodeGetValue ( result ) if ( result == "true" ) then return true elseif ( result == "false" ) then return false else return result end end return false end function aSetSetting ( setting, value ) local node = xmlFindChild ( _settings, tostring ( setting ), 0 ) if ( not node ) then node = Link to comment
N3xT Posted June 16, 2016 Share Posted June 16, 2016 شغال عندي وكل شيء تمام , المشكلة من عندك Link to comment
SaedAmer Posted June 16, 2016 Author Share Posted June 16, 2016 لو العيب من عندي قول الخطأ فين سيرفر --[[********************************** * * Multi Theft Auto - Admin Panel * * admin_server.lua * * Original File by lil_Toady * **************************************]] _root = getRootElement() _types = { "player", "team", "vehicle", "resource", "bans", "server", "admin" } _settings = nil aPlayers = {} aLogMessages = {} aInteriors = {} aStats = {} aReports = {} aWeathers = {} aNickChangeTime = {} local aUnmuteTimerList = {} Groups = { "Admin", "Console", "Head.Admin", "Level 6", "Level 5" } function notifyPlayerLoggedIn(player) exports["vMZ-TopBar"]:sendClientMessage ( "Press 'p' to open your admin panel", player ) local unread = 0 for _, msg in ipairs ( aReports ) do unread = unread + ( msg.read and 0 or 1 ) end if unread > 0 then exports["vMZ-TopBar"]:sendClientMessage( unread .. " unread Admin message" .. ( unread==1 and "" or "s" ), player, 255, 0, 0 ) end end addEventHandler ( "onResourceStart", _root, function ( resource ) if ( resource ~= getThisResource() ) then for id, player in ipairs(getElementsByType("player")) do if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then triggerClientEvent ( player, "aClientResourceStart", _root, getResourceName ( resource ) ) end end return end _settings = xmlLoadFile ( "conf\\settings.xml" ) if ( not _settings ) then _settings = xmlCreateFile ( "conf\\settings.xml", "main" ) xmlSaveFile ( _settings ) end aSetupACL() aSetupCommands() for id, player in ipairs ( getElementsByType ( "player" ) ) do aPlayerInitialize ( player ) if ( hasObjectPermissionTo ( player, "general.adminpanel" ) ) then notifyPlayerLoggedIn(player) end end local node = xmlLoadFile ( "conf\\interiors.xml" ) if ( node ) then local interiors = 0 while ( xmlFindChild ( node, "interior", interiors ) ) do local interior = xmlFindChild ( node, "interior", interiors ) interiors = interiors + 1 aInteriors[interiors] = {} aInteriors[interiors]["world"] = tonumber ( xmlNodeGetAttribute ( interior, "world" ) ) aInteriors[interiors]["id"] = xmlNodeGetAttribute ( interior, "id" ) aInteriors[interiors]["x"] = xmlNodeGetAttribute ( interior, "posX" ) aInteriors[interiors]["y"] = xmlNodeGetAttribute ( interior, "posY" ) aInteriors[interiors]["z"] = xmlNodeGetAttribute ( interior, "posZ" ) aInteriors[interiors]["r"] = xmlNodeGetAttribute ( interior, "rot" ) end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\stats.xml" ) if ( node ) then local stats = 0 while ( xmlFindChild ( node, "stat", stats ) ) do local stat = xmlFindChild ( node, "stat", stats ) local id = tonumber ( xmlNodeGetAttribute ( stat, "id" ) ) local name = xmlNodeGetAttribute ( stat, "name" ) aStats[id] = name stats = stats + 1 end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\weathers.xml" ) if ( node ) then local weathers = 0 while ( xmlFindChild ( node, "weather", weathers ) ~= false ) do local weather = xmlFindChild ( node, "weather", weathers ) local id = tonumber ( xmlNodeGetAttribute ( weather, "id" ) ) local name = xmlNodeGetAttribute ( weather, "name" ) aWeathers[id] = name weathers = weathers + 1 end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\eports.xml" ) if ( node ) then local messages = 0 while ( xmlFindChild ( node, "message", messages ) ) do subnode = xmlFindChild ( node, "message", messages ) local author = xmlFindChild ( subnode, "author", 0 ) local subject = xmlFindChild ( subnode, "subject", 0 ) local category = xmlFindChild ( subnode, "category", 0 ) local text = xmlFindChild ( subnode, "text", 0 ) local time = xmlFindChild ( subnode, "time", 0 ) local read = ( xmlFindChild ( subnode, "read", 0 ) ~= false ) local id = #aReports + 1 aReports[id] = {} if ( author ) then aReports[id].author = xmlNodeGetValue ( author ) else aReports[id].author = "" end if ( category ) then aReports[id].category = xmlNodeGetValue ( category ) else aReports[id].category = "" end if ( subject ) then aReports[id].subject = xmlNodeGetValue ( subject ) else aReports[id].subject = "" end if ( text ) then aReports[id].text = xmlNodeGetValue ( text ) else aReports[id].text = "" end if ( time ) then aReports[id].time = xmlNodeGetValue ( time ) else aReports[id].time = "" end aReports[id].read = read messages = messages + 1 end -- Remove duplicates local a = 1 while a <= #aReports do local b = a + 1 while b <= #aReports do if table.cmp( aReports[a], aReports[b] ) then table.remove( aReports, b ) b = b - 1 end b = b + 1 end a = a + 1 end -- Upgrade time from '4/9 5:9' to '2009-09-04 05:09' for id, rep in ipairs ( aReports ) do if string.find( rep.time, "/" ) then local monthday, month, hour, minute = string.match( rep.time, "^(.-)/(.-) (.-).-)$" ) rep.time = string.format( '%04d-%02d-%02d %02d:%02d', 2009, month + 1, monthday, hour, minute ) end end -- Sort messages by time table.sort(aReports, function(a,b) return(a.time < b.time) end) -- Limit number of messages while #aReports > g_Prefs.maxmsgs do table.remove( aReports, 1 ) end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\messages.xml" ) if ( node ) then for id, type in ipairs ( _types ) do local subnode = xmlFindChild ( node, type, 0 ) if ( subnode ) then aLogMessages[type] = {} local groups = 0 while ( xmlFindChild ( subnode, "group", groups ) ) do local group = xmlFindChild ( subnode, "group", groups ) local action = xmlNodeGetAttribute ( group, "action" ) local r = tonumber ( xmlNodeGetAttribute ( group, "r" ) ) local g = tonumber ( xmlNodeGetAttribute ( group, "g" ) ) local b = tonumber ( xmlNodeGetAttribute ( group, "b" ) ) aLogMessages[type][action] = {} aLogMessages[type][action]["r"] = r or 0 aLogMessages[type][action]["g"] = g or 255 aLogMessages[type][action]["b"] = b or 0 if ( xmlFindChild ( group, "all", 0 ) ) then aLogMessages[type][action]["all"] = xmlNodeGetValue ( xmlFindChild ( group, "all", 0 ) ) end if ( xmlFindChild ( group, "admin", 0 ) ) then aLogMessages[type][action]["admin"] = xmlNodeGetValue ( xmlFindChild ( group, "admin", 0 ) ) end if ( xmlFindChild ( group, "player", 0 ) ) then aLogMessages[type][action]["player"] = xmlNodeGetValue ( xmlFindChild ( group, "player", 0 ) ) end if ( xmlFindChild ( group, "log", 0 ) ) then aLogMessages[type][action]["log"] = xmlNodeGetValue ( xmlFindChild ( group, "log", 0 ) ) end groups = groups + 1 end end end xmlUnloadFile ( node ) end end ) addEventHandler ( "onResourceStop", _root, function ( resource ) -- Incase the resource being stopped has been deleted local stillExists = false for i, res in ipairs(getResources()) do if res == resource then stillExists = true break end end if not stillExists then return end if ( resource ~= getThisResource() ) then for id, player in ipairs(getElementsByType("player")) do if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then triggerClientEvent ( player, "aClientResourceStop", _root, getResourceName ( resource ) ) end end else local node = xmlLoadFile ( "conf\\eports.xml" ) if ( node ) then while ( xmlFindChild ( node, "message", 0 ) ~= false ) do local subnode = xmlFindChild ( node, "message", 0 ) xmlDestroyNode ( subnode ) end else node = xmlCreateFile ( "conf\\eports.xml", "messages" ) end for id, message in ipairs ( aReports ) do local subnode = xmlCreateChild ( node, "message" ) for key, value in pairs ( message ) do if ( value ) then xmlNodeSetValue ( xmlCreateChild ( subnode, key ), tostring ( value ) ) end end end xmlSaveFile ( node ) xmlUnloadFile ( node ) -- Unmute anybody muted by admin for i, player in ipairs(getElementsByType("player")) do local serial = getPlayerSerial( player ) if (aUnmuteTimerList[serial]) then aUnmuteTimerList[serial] = nil setPlayerMuted(player, false) end end end aclSave () end ) function aGetSetting ( setting ) local result = xmlFindChild ( _settings, tostring ( setting ), 0 ) if ( result ) then result = xmlNodeGetValue ( result ) if ( result == "true" ) then return true elseif ( result == "false" ) then return false else return result end end return false end function aSetSetting ( setting, value ) Link to comment
N3xT Posted June 17, 2016 Share Posted June 17, 2016 ممكن تقولي وش يطلع لك بالديبق ؟ ولا تبيني أفتش لك بـ 1500 سطر ؟ Link to comment
SaedAmer Posted June 17, 2016 Author Share Posted June 17, 2016 خلاص حليتها اخي بس في مشكلة دلوقتي انا معي رتب كونسول و ادمن و ادمن1 و سعيد عامر بس ما يردي يفك الميوت ! --[[********************************** * * Multi Theft Auto - Admin Panel * * admin_server.lua * * Original File by lil_Toady * **************************************]] _root = getRootElement() _types = { "player", "team", "vehicle", "resource", "bans", "server", "admin" } _settings = nil aPlayers = {} aLogMessages = {} aInteriors = {} aStats = {} aReports = {} aWeathers = {} aNickChangeTime = {} local aUnmuteTimerList = {} Groups = { "Admin", "Console", "Head.Admin", "Level 6", "Level 5", "Admin1", "SaedAmer", } function notifyPlayerLoggedIn(player) exports["vMZ-TopBar"]:sendClientMessage ( "Press 'p' to open your admin panel", player ) local unread = 0 for _, msg in ipairs ( aReports ) do unread = unread + ( msg.read and 0 or 1 ) end if unread > 0 then exports["vMZ-TopBar"]:sendClientMessage( unread .. " unread Admin message" .. ( unread==1 and "" or "s" ), player, 255, 0, 0 ) end end addEventHandler ( "onResourceStart", _root, function ( resource ) if ( resource ~= getThisResource() ) then for id, player in ipairs(getElementsByType("player")) do if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then triggerClientEvent ( player, "aClientResourceStart", _root, getResourceName ( resource ) ) end end return end _settings = xmlLoadFile ( "conf\\settings.xml" ) if ( not _settings ) then _settings = xmlCreateFile ( "conf\\settings.xml", "main" ) xmlSaveFile ( _settings ) end aSetupACL() aSetupCommands() for id, player in ipairs ( getElementsByType ( "player" ) ) do aPlayerInitialize ( player ) if ( hasObjectPermissionTo ( player, "general.adminpanel" ) ) then notifyPlayerLoggedIn(player) end end local node = xmlLoadFile ( "conf\\interiors.xml" ) if ( node ) then local interiors = 0 while ( xmlFindChild ( node, "interior", interiors ) ) do local interior = xmlFindChild ( node, "interior", interiors ) interiors = interiors + 1 aInteriors[interiors] = {} aInteriors[interiors]["world"] = tonumber ( xmlNodeGetAttribute ( interior, "world" ) ) aInteriors[interiors]["id"] = xmlNodeGetAttribute ( interior, "id" ) aInteriors[interiors]["x"] = xmlNodeGetAttribute ( interior, "posX" ) aInteriors[interiors]["y"] = xmlNodeGetAttribute ( interior, "posY" ) aInteriors[interiors]["z"] = xmlNodeGetAttribute ( interior, "posZ" ) aInteriors[interiors]["r"] = xmlNodeGetAttribute ( interior, "rot" ) end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\stats.xml" ) if ( node ) then local stats = 0 while ( xmlFindChild ( node, "stat", stats ) ) do local stat = xmlFindChild ( node, "stat", stats ) local id = tonumber ( xmlNodeGetAttribute ( stat, "id" ) ) local name = xmlNodeGetAttribute ( stat, "name" ) aStats[id] = name stats = stats + 1 end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\weathers.xml" ) if ( node ) then local weathers = 0 while ( xmlFindChild ( node, "weather", weathers ) ~= false ) do local weather = xmlFindChild ( node, "weather", weathers ) local id = tonumber ( xmlNodeGetAttribute ( weather, "id" ) ) local name = xmlNodeGetAttribute ( weather, "name" ) aWeathers[id] = name weathers = weathers + 1 end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\eports.xml" ) if ( node ) then local messages = 0 while ( xmlFindChild ( node, "message", messages ) ) do subnode = xmlFindChild ( node, "message", messages ) local author = xmlFindChild ( subnode, "author", 0 ) local subject = xmlFindChild ( subnode, "subject", 0 ) local category = xmlFindChild ( subnode, "category", 0 ) local text = xmlFindChild ( subnode, "text", 0 ) local time = xmlFindChild ( subnode, "time", 0 ) local read = ( xmlFindChild ( subnode, "read", 0 ) ~= false ) local id = #aReports + 1 aReports[id] = {} if ( author ) then aReports[id].author = xmlNodeGetValue ( author ) else aReports[id].author = "" end if ( category ) then aReports[id].category = xmlNodeGetValue ( category ) else aReports[id].category = "" end if ( subject ) then aReports[id].subject = xmlNodeGetValue ( subject ) else aReports[id].subject = "" end if ( text ) then aReports[id].text = xmlNodeGetValue ( text ) else aReports[id].text = "" end if ( time ) then aReports[id].time = xmlNodeGetValue ( time ) else aReports[id].time = "" end aReports[id].read = read messages = messages + 1 end -- Remove duplicates local a = 1 while a <= #aReports do local b = a + 1 while b <= #aReports do if table.cmp( aReports[a], aReports[b] ) then table.remove( aReports, b ) b = b - 1 end b = b + 1 end a = a + 1 end -- Upgrade time from '4/9 5:9' to '2009-09-04 05:09' for id, rep in ipairs ( aReports ) do if string.find( rep.time, "/" ) then local monthday, month, hour, minute = string.match( rep.time, "^(.-)/(.-) (.-).-)$" ) rep.time = string.format( '%04d-%02d-%02d %02d:%02d', 2009, month + 1, monthday, hour, minute ) end end -- Sort messages by time table.sort(aReports, function(a,b) return(a.time < b.time) end) -- Limit number of messages while #aReports > g_Prefs.maxmsgs do table.remove( aReports, 1 ) end xmlUnloadFile ( node ) end local node = xmlLoadFile ( "conf\\messages.xml" ) if ( node ) then for id, type in ipairs ( _types ) do local subnode = xmlFindChild ( node, type, 0 ) if ( subnode ) then aLogMessages[type] = {} local groups = 0 while ( xmlFindChild ( subnode, "group", groups ) ) do local group = xmlFindChild ( subnode, "group", groups ) local action = xmlNodeGetAttribute ( group, "action" ) local r = tonumber ( xmlNodeGetAttribute ( group, "r" ) ) local g = tonumber ( xmlNodeGetAttribute ( group, "g" ) ) local b = tonumber ( xmlNodeGetAttribute ( group, "b" ) ) aLogMessages[type][action] = {} aLogMessages[type][action]["r"] = r or 0 aLogMessages[type][action]["g"] = g or 255 aLogMessages[type][action]["b"] = b or 0 if ( xmlFindChild ( group, "all", 0 ) ) then aLogMessages[type][action]["all"] = xmlNodeGetValue ( xmlFindChild ( group, "all", 0 ) ) end if ( xmlFindChild ( group, "admin", 0 ) ) then aLogMessages[type][action]["admin"] = xmlNodeGetValue ( xmlFindChild ( group, "admin", 0 ) ) end if ( xmlFindChild ( group, "player", 0 ) ) then aLogMessages[type][action]["player"] = xmlNodeGetValue ( xmlFindChild ( group, "player", 0 ) ) end if ( xmlFindChild ( group, "log", 0 ) ) then aLogMessages[type][action]["log"] = xmlNodeGetValue ( xmlFindChild ( group, "log", 0 ) ) end groups = groups + 1 end end end xmlUnloadFile ( node ) end end ) addEventHandler ( "onResourceStop", _root, function ( resource ) -- Incase the resource being stopped has been deleted local stillExists = false for i, res in ipairs(getResources()) do if res == resource then stillExists = true break end end if not stillExists then return end if ( resource ~= getThisResource() ) then for id, player in ipairs(getElementsByType("player")) do if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then triggerClientEvent ( player, "aClientResourceStop", _root, getResourceName ( resource ) ) end end else local node = xmlLoadFile ( "conf\\eports.xml" ) if ( node ) then while ( xmlFindChild ( node, "message", 0 ) ~= false ) do local subnode = xmlFindChild ( node, "message", 0 ) xmlDestroyNode ( subnode ) end else node = xmlCreateFile ( "conf\\eports.xml", "messages" ) end for id, message in ipairs ( aReports ) do local subnode = xmlCreateChild ( node, "message" ) for key, value in pairs ( message ) do if ( value ) then xmlNodeSetValue ( xmlCreateChild ( subnode, key ), tostring ( value ) ) end end end xmlSaveFile ( node ) xmlUnloadFile ( node ) -- Unmute anybody muted by admin for i, player in ipairs(getElementsByType("player")) do local serial = getPlayerSerial( player ) if (aUnmuteTimerList[serial]) then aUnmuteTimerList[serial] = nil setPlayerMuted(player, false) end end end aclSave () end ) function aGetSetting ( setting ) local result = xmlFindChild ( _settings, tostring ( setting ), 0 ) if ( result ) then result = xmlNodeGetValue ( result ) if ( result == "true" ) then return true elseif ( result == "false" ) then return false else return result end end return false end Link to comment
Me[Z]oO Posted June 17, 2016 Share Posted June 17, 2016 (edited) مساعده يا اخي انت ولعبة حاولو تعتمدوا علي حالكم شوي وش بك انت وهو كل يوم 15 موضوع ومحتواهم تافه -,- روح حاول تعتمد علي نفسك شوي Edited June 17, 2016 by Guest 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