Ximboliex 85 Report post Posted October 28, 2016 (edited) Please help could help me create a script so that the leader can call all guild members to its location. Scrip for Itemeffect.lua(double click) --I'd appreciate it very much Edited October 28, 2016 by Ximboliex Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted October 28, 2016 You can't. Unless you store a player's role with their respective guild information and then make a item to go through the stored information to call players. Quote Share this post Link to post Share on other sites
Ximboliex 85 Report post Posted October 28, 2016 1 hour ago, Angelix said: You can't. Unless you store a player's role with their respective guild information and then make a item to go through the stored information to call players. I was thinking that I do not know where to start rather not do could publish as part of the script? @Angelix or @Totoka please? Quote Share this post Link to post Share on other sites
Nobre 38 Report post Posted October 28, 2016 26 minutes ago, Ximboliex said: I was thinking that I do not know where to start rather not do could publish as part of the script? @Angelix or @Totoka please? wont that be too broken? you can do it for fun but i think that wont be good for the game 1 Quote Share this post Link to post Share on other sites
Ximboliex 85 Report post Posted October 28, 2016 5 minutes ago, Nobre said: wont that be too broken? you can do it for fun but i think that wont be good for the game no matter what adjustments will because I'm thinking how to implement Thank's @Nobre Quote Share this post Link to post Share on other sites
Nobre 38 Report post Posted October 28, 2016 1 minute ago, Ximboliex said: no matter what adjustments will because I'm thinking how to implement Thank's @Nobre anyway i advice you to try and build it you can get a good mecanic that can be used in certain types of maps Quote Share this post Link to post Share on other sites
Ximboliex 85 Report post Posted October 29, 2016 3 hours ago, Nobre said: anyway i advice you to try and build it you can get a good mecanic that can be used in certain types of maps Ok @Nobre Quote Share this post Link to post Share on other sites
Shako 97 Report post Posted October 29, 2016 (edited) @Ximboliex GetGuildLeaderID = Leader ID GetGuildID = Guild ID U cant do what u said in a function of item alone, because it executes on 1 player. U have to hook it to something like a cha_timer, and then let that function teleport the players. Edited October 29, 2016 by Shako Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted October 29, 2016 @Shako It won't work. 1) We don't have function GetGuildLeaderID(); 3) Use GetChaGuildID() instead of GetGuildID(); 4) You should compare guild leader id with character's ID, not with 1; 5) You should use GuildSummon as array: GuildSummon[GuildID] = 1 6) In cha_timer() you should check if role is a player; 7) Script in cha_timer() will look like: if (IsPlayer(role) == 1) then local GuildID = GetChaGuildID(role) if (GuildSummon[GuildID] ~= nil) then GuildSummon[GuildID] = nil MoveCity(role, "Guild House") end end 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
AlGhoul 66 Report post Posted November 19, 2016 (edited) On 10/28/2016 at 11:07 PM, Ximboliex said: Please help could help me create a script so that the leader can call all guild members to its location. Scrip for Itemeffect.lua(double click) --I'd appreciate it very much Here You Go, But Make Sure All Credit To Yudha Put This In Your functions.lua -------------------------------------------------------------------------------------- function IsCanBeSummoned(role) local cha_lv = Lv(role) local cha_job = GetChaAttr(role,ATTR_JOB) local Slot1 = GetChaItem(role,1,9) local Slot1_ID = GetItemID (Slot1) local BoatCheck = ChaIsBoat(role) if cha_lv <= 100 then return false end if cha_job <= 0 then return false end if Slot1_ID == 207 or Slot1_ID == 208 or Slot1_ID == 3108 then return false end if BoatCheck == 1 then return false end return true end --------------------------------------------------------------------------------------------------------------- And This In Your Functions.lua -------------------------------------------------------------------------------------------------------------- function CallAllTeleport(role, freq, time) local now_ticking = GetChaParam(role, 1) local characterName = GetChaDefaultName( role ) local delay = math.random(1,10) if IsCanBeSummoned(role) == true then if(GetName[characterName] ~= nil and _CallAll.Players[characterName] ~= nil)then if math.mod(now_ticking, delay) == 0 and now_ticking > 0 then BickerNotice(role,"Guild leader calling..!") GoTo( role, _CallAll.Settings.X_Cord, _CallAll.Settings.Y_Cord, _CallAll.Settings.Map ) _CallAll.Players[characterName] = nil end end end end --------------------------------------------------------------------------------------------------------------------------- Then This In Your ItemEffect.lua ---------------------------------------------------------------------------------------------------------------------------- function ItemUse_guildroar(role,Item) local map_name = GetChaMapName(role) if map_name == "hiddencamp" or map_name == "newbie" then UseItemFailed ( role ) SystemNotice(role ,"Unable to calls guild members from here !") end local Leader_GuildID = GetChaGuildID( role ) if Leader_GuildID < 1 then UseItemFailed ( role ) SystemNotice(role ,"You dont have guild yet !") end local leader = IsGuildLeader(role) if leader == 1 then local x,y = GetChaPos(role) local map = GetChaMapName(role) for users,characters in pairs(GetName) do local characterName = GetChaDefaultName(characters) local Guild = GetChaGuildID(characters) if Guild == Leader_GuildID then _CallAll.Settings = { Map = map, X_Cord = math.floor (x/100), Y_Cord = math.floor (y/100) } _CallAll.Players[characterName] = {} CallAllTeleport(characters) end end else UseItemFailed ( role ) BickerNotice(role ,"You are not Guild leader !") end end ----------------------------------------------------------------------------------------------------------------------------- Last in Iteminfo.txt 9003 Guild Roar trumpet 10130005 0 0 0 0 0 0 31 0 0 0 0 0 1 1 1 1 500 0 0 -1,-2,-2,-2 0 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 ItemUse_guildroar 0 0 0 0,0 0 0 Click it to calls guild members 0 ------------------------------------------------------------------------------------------------------------------------------ Note: This Call All Members In Same GameServer Maybe @KONG or @V3ct0r or @Billy And Others Can Fix It Edited November 19, 2016 by J0k3r 1 Quote Kind regards, AG. Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted November 19, 2016 Hi joker. Nice script indeed. But If this was up to me, I would do the function inside groupserver.exe. When I get home I'll check it out for you guys. Quote Share this post Link to post Share on other sites
AlGhoul 66 Report post Posted November 19, 2016 11 minutes ago, KONG said: Hi joker. Nice script indeed. But If this was up to me, I would do the function inside groupserver.exe. When I get home I'll check it out for you guys. OKay @KONG Waitting You Quote Kind regards, AG. Share this post Link to post Share on other sites
Saeed 26 Report post Posted November 20, 2016 On 11/19/2016 at 3:45 PM, J0k3r said: Here You Go, But Make Sure All Credit To Yudha Put This In Your functions.lua -------------------------------------------------------------------------------------- function IsCanBeSummoned(role) local cha_lv = Lv(role) local cha_job = GetChaAttr(role,ATTR_JOB) local Slot1 = GetChaItem(role,1,9) local Slot1_ID = GetItemID (Slot1) local BoatCheck = ChaIsBoat(role) if cha_lv <= 100 then return false end if cha_job <= 0 then return false end if Slot1_ID == 207 or Slot1_ID == 208 or Slot1_ID == 3108 then return false end if BoatCheck == 1 then return false end return true end --------------------------------------------------------------------------------------------------------------- And This In Your Functions.lua -------------------------------------------------------------------------------------------------------------- function CallAllTeleport(role, freq, time) local now_ticking = GetChaParam(role, 1) local characterName = GetChaDefaultName( role ) local delay = math.random(1,10) if IsCanBeSummoned(role) == true then if(GetName[characterName] ~= nil and _CallAll.Players[characterName] ~= nil)then if math.mod(now_ticking, delay) == 0 and now_ticking > 0 then BickerNotice(role,"Guild leader calling..!") GoTo( role, _CallAll.Settings.X_Cord, _CallAll.Settings.Y_Cord, _CallAll.Settings.Map ) _CallAll.Players[characterName] = nil end end end end --------------------------------------------------------------------------------------------------------------------------- Then This In Your ItemEffect.lua ---------------------------------------------------------------------------------------------------------------------------- function ItemUse_guildroar(role,Item) local map_name = GetChaMapName(role) if map_name == "hiddencamp" or map_name == "newbie" then UseItemFailed ( role ) SystemNotice(role ,"Unable to calls guild members from here !") end local Leader_GuildID = GetChaGuildID( role ) if Leader_GuildID < 1 then UseItemFailed ( role ) SystemNotice(role ,"You dont have guild yet !") end local leader = IsGuildLeader(role) if leader == 1 then local x,y = GetChaPos(role) local map = GetChaMapName(role) for users,characters in pairs(GetName) do local characterName = GetChaDefaultName(characters) local Guild = GetChaGuildID(characters) if Guild == Leader_GuildID then _CallAll.Settings = { Map = map, X_Cord = math.floor (x/100), Y_Cord = math.floor (y/100) } _CallAll.Players[characterName] = {} CallAllTeleport(characters) end end else UseItemFailed ( role ) BickerNotice(role ,"You are not Guild leader !") end end ----------------------------------------------------------------------------------------------------------------------------- Last in Iteminfo.txt 9003 Guild Roar trumpet 10130005 0 0 0 0 0 0 31 0 0 0 0 0 1 1 1 1 500 0 0 -1,-2,-2,-2 0 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 ItemUse_guildroar 0 0 0 0,0 0 0 Click it to calls guild members 0 ------------------------------------------------------------------------------------------------------------------------------ Note: This Call All Members In Same GameServer Maybe @KONG or @V3ct0r or @Billy And Others Can Fix It just use table.save to save the leader location and recall using cha_timer "table.load". Quote Share this post Link to post Share on other sites