V3ct0r 2,117 Report post Posted May 12, 2017 Getting guild leader ID Hello friends! In this guide I will tell you how to get leader ID of any guild: local guild_id = 100 local leader_id = GetGuildLeaderID(guild_id) Notice("Guild ID " .. guild_id .. " leader ID: " .. leader_id) First of all, open file exp_and_level.lua and find function DeductGuildItem. Then before this string if Guild_type == 1 then add the following code: local file = io.open("guild/"..GetChaGuildID(role)..".txt", "w+") if file ~= nil then file:write (GetRoleID(role)) file:close() end It will write leader ID into file with name of guild ID. Now we should develop GetGuildLeaderID(<guild_id>) function. Put to file functions.lua this code: function GetGuildLeaderID(guild_id) local leader_id = 0 local file = io.open("guild/" .. guild_id.. ".txt", "r") if (file ~= nil) then leader_id = file:read("*n") file:close() end return leader_id end That's all! 6 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
1g0rS1lv4 68 Report post Posted May 17, 2017 Could you tell me how do I get the EXP and GOLD guild for a TXT? Quote Being better than others is for those who are weak; what matters is to be true to yourself. Share this post Link to post Share on other sites
Fajar 1 Report post Posted May 17, 2017 On 5/12/2017 at 3:53 PM, V3ct0r said: local guild_id = 100 local leader_id = GetGuildLeaderID(guild_id) Notice("Guild ID " .. guild_id .. " leader ID: " .. leader_id) On 5/12/2017 at 3:53 PM, V3ct0r said: @V3ct0r Where i can put this code? Quote Share this post Link to post Share on other sites
WVWMK 121 Report post Posted May 17, 2017 @Fajar You can use this code anywhere This function call : local leader_id = GetGuildLeaderID(guild_id) Example : function GetExp_PKM( dead , atk ) ......... local Guild_ID = GetChaGuildID(atk) -- get Guild ID local Guild_ATKER = GetGuildName( Guild_ID ) -- get Guild Name local Leader = GetGuildLeaderID ( Guild_ID ) -- get Guild Leader local rand_item = math.random(1,1) if rand_item ~= 1 then if Leaders[Leader] == nil then Leaders[Leader] = {vaule = 1938202} end Leaders[Leader].vaule = Leaders[Leader].vaule + 1500302 end ............ end Quote Делай добро и бросай его в воду Share this post Link to post Share on other sites
Ximboliex 85 Report post Posted May 17, 2017 22 hours ago, 1g0rS1lv4 said: Could you tell me how do I get the EXP and GOLD guild for a TXT? You need edit that direct to database whit "LuaSQL" cmd because in the game don't exist that function. Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted May 18, 2017 В 17.05.2017 в 09:58, Fajar сказал: @V3ct0r Where i can put this code? This code is just example of usage function GetGuildLeaderID() Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted May 18, 2017 В 17.05.2017 в 04:05, 1g0rS1lv4 сказал: Could you tell me how do I get the EXP and GOLD guild for a TXT? This can not be done from scripts and txt. But you can use LuaSQL extension for GameServer.exe, as @Ximboliex said: Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
1g0rS1lv4 68 Report post Posted May 18, 2017 11 hours ago, V3ct0r said: Isso não pode ser feito de scripts e txt. Mas você pode usar a extensão LuaSQL para GameServer.exe, como @Ximboliex disse: thx @V3ct0r Quote Being better than others is for those who are weak; what matters is to be true to yourself. Share this post Link to post Share on other sites