Vasil 71 Report post Posted September 2, 2016 (edited) Hi , i'm actually scripting a new system [Guild Leveling System] I got blocked on a part. It's to detect if the member is the Guild Leader and if the player is in guild Guild Leader Detection : To Upgrade the Guild Level Player In Guild Detection : For the bonus of stats of guild & the Glow Any help would be appreciated Thank's In Advance Edited September 2, 2016 by Vasil Quote Share this post Link to post Share on other sites
Angelix 376 Report post Posted September 3, 2016 (edited) There is a way to detect if a player belongs to a guild, it will just return the ID of the guild back. If you are using variables/tables to store all things related to your guild system, then that might be a useful thing. GetChaGuildID(Player) About a check to see if leader or not, haven't searched enough in files yet. You may additionally retrieve guild's name when inserting their guild ID with this function. GetGuildName(GuildID) Well I tried looking for a function that checks if a player is/isn't leader of the guild it currently is member of and I couldn't find anything. Yet I remember that the NPC that lets bid against other guilds in other to participated in guild wars only allows you to bid only if you are leader (if I'm not mistaken), so maybe it is done internally within the GameServer. Edited September 3, 2016 by Angelix Quote Share this post Link to post Share on other sites
V3ct0r 2,122 Report post Posted September 3, 2016 Hello @Vasil There is no such function. As a solution you can write leader id to file when he makes guild. Then make function which will read that file and return leader id. 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
Vasil 71 Report post Posted September 3, 2016 4 hours ago, Angelix said: There is a way to detect if a player belongs to a guild, it will just return the ID of the guild back. If you are using variables/tables to store all things related to your guild system, then that might be a useful thing. GetChaGuildID(Player) About a check to see if leader or not, haven't searched enough in files yet. You may additionally retrieve guild's name when inserting their guild ID with this function. GetGuildName(GuildID) Well I tried looking for a function that checks if a player is/isn't leader of the guild it currently is member of and I couldn't find anything. Yet I remember that the NPC that lets bid against other guilds in other to participated in guild wars only allows you to bid only if you are leader (if I'm not mistaken), so maybe it is done internally within the GameServer. Gonna test it , thank you 1 Quote Share this post Link to post Share on other sites
V3ct0r 2,122 Report post Posted September 3, 2016 exp_and_level.lua, function DeductGuildItem() before the line if Guild_type == 1 then add local file = io.open("guild/"..GetChaGuildID(role)..".txt", "w+") if file ~= nil then file:write (GetRoleID(role)) file:close() end functions.lua, add new function IsGuildLeader() function IsGuildLeader(role) local result = 0 if HasGuild(role) ~= 0 then local file = io.open("guild/"..GetChaGuildID(role)..".txt", "r") if file ~= nil then if GetRoleID(role) == file:read("*n") then result = 1 end file:close() end end return result end Credits to Larein from Russian community 2 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
Vasil 71 Report post Posted September 3, 2016 2 hours ago, V3ct0r said: exp_and_level.lua, function DeductGuildItem() before the line if Guild_type == 1 then add local file = io.open("guild/"..GetChaGuildID(role)..".txt", "w+") if file ~= nil then file:write (GetRoleID(role)) file:close() end functions.lua, add new function IsGuildLeader() function IsGuildLeader(role) local result = 0 if HasGuild(role) ~= 0 then local file = io.open("guild/"..GetChaGuildID(role)..".txt", "r") if file ~= nil then if GetRoleID(role) == file:read("*n") then result = 1 end file:close() end end return result end Credits to Larein from Russian community Thank you , i completted my Guild Leveling System now , works perfect .Thank you again Quote Share this post Link to post Share on other sites
Shako 97 Report post Posted September 3, 2016 1 hour ago, Vasil said: Thank you , i completted my Guild Leveling System now , works perfect .Thank you again Can you show us what you did? I am a bit interested 1 Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
Vasil 71 Report post Posted September 3, 2016 1 hour ago, Shako said: Can you show us what you did? I am a bit interested -[*]Levelable Guild MemberShip System -[*]Additional Stats For Your Character -[*]Registration by NPC -[*]Max Level for the MemberShip is Level 4. -[*]Made GetGuildLv Function to obtain Member Guild MemberShip Level(Used on NPC) -[*]Increase Drop Rate Percentage for a Little Bit : Lv1 +5% Drop Rate Lv2 +10% Lv3 +15% Lv4 +20% -[*]A Bonus of Exp Rate Quote Share this post Link to post Share on other sites
Eviles 179 Report post Posted September 3, 2016 For check if is Guild Leader i've did it: function IsGuildLeader(role) local Alliance = GetChaGuildID(role) local PlayerID = GetCharID(role) local LeaderID = GetGuildLeaderID(Alliance) if PlayerID ~= LeaderID then return LUA_FALSE else return LUA_TRUE end end I think GetGuildLeaderID is in V3ct0r GameSv, if i'm sure. 1 Quote Share this post Link to post Share on other sites
Vasil 71 Report post Posted September 3, 2016 3 hours ago, Satan said: For check if is Guild Leader i've did it: function IsGuildLeader(role) local Alliance = GetChaGuildID(role) local PlayerID = GetCharID(role) local LeaderID = GetGuildLeaderID(Alliance) if PlayerID ~= LeaderID then return LUA_FALSE else return LUA_TRUE end end I think GetGuildLeaderID is in V3ct0r GameSv, if i'm sure. For sure i'll use these scripts to modify my system.Thanks Quote Share this post Link to post Share on other sites