Cr4sh 0 Report post Posted June 20, 2016 Hello ,I've tried to give player item using &lua cmd , but it doesn't give it It says lua_GiveItem Parameter Error and so on. while i've set up 3 parameters(id,quantity,quality) it still show the error is it possible to do that anyway? Thanks in advance! Quote Share this post Link to post Share on other sites
Billy 164 Report post Posted June 20, 2016 Problem is getting role. Set up a function to save players role to a table (eg PlayerRole[GetRoleID(role)] = role ) , then use that table to execute command as the role parameter Quote Share this post Link to post Share on other sites
Xeon 67 Report post Posted June 20, 2016 GiveItem has 5 parameters to be exact GiveItem(role, 0, itemid, quantity, quality) function GiveItem2Player(characterName, id, quantity, quality) local role = PlayerRole[characterName] GiveItem(role, 0, id, quantity, quality); end Further more you need to add a couple lines in cha_timer to save the role Above function cha_timer(role,freq,time) add PlayerRole = { } if(IsPlayer(role) == 1) then PlayerRole[GetChaDefaultName(role)] = role; end This is only one of many simple ways to go about this. Quote Share this post Link to post Share on other sites
Billy 164 Report post Posted June 20, 2016 (edited) @Xeon Using IsPlayer(role) == 1 doesnt stop boats being used, and GetChaDefaultName on a boat gives the boats name, not the players name. That could be abused to trick the admin into spawning items for the wrong player. You should also do a check if the player is a boat to prevent this. Edited June 20, 2016 by 7n6 Quote Share this post Link to post Share on other sites
Xeon 67 Report post Posted June 20, 2016 The use of IsPlayer, was not meant for this @7n6It was only meant for not getting monsters & npcs into the list, fyi this was just a quick draft of a script, nothing more before. Before criticizing why not try to help I was refering to his question nothing more, and if an "admin" is tricked when giving items to a player, when they are the one executing the command in the first place isnt likely. He was only asking about a parameter error nothing more. Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted June 20, 2016 He does make a good point jay ^^ But, simple fix: local cha = TurnToCha(role) if(IsPlayer(cha) == 1) then PlayerRole[GetChaDefaultName(cha)] = cha; end But i guess things like this belongs within the src codes itself. Maybe you can do that jay. Quote Share this post Link to post Share on other sites
Cr4sh 0 Report post Posted June 20, 2016 Much appreciated guys =) Cheerss to you Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted June 21, 2016 I have GameServer.exe with GetChaByName() function. I will release it soon or show how to add the function to GameServer.exe local cha, online = GetChaByName("Cr4sh") if (online == true) then Notice("Character Cr4sh is online! Let's give to him an item!") GiveItem(cha, 0, id, quantity, quality) else Notice("Character Cr4sh is offline or on another GameServer.exe! ") end Topic is moved to 'Questions & Help' section. 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
Cr4sh 0 Report post Posted June 22, 2016 And i also meant like when uu hacking a server or smth(example) and u want to give ur self item by using &lua GiveItem how can i do that Quote Share this post Link to post Share on other sites
Wrexor 61 Report post Posted June 22, 2016 You don't. Hackers get no support. 6 Quote Share this post Link to post Share on other sites
GummyBear 6 Report post Posted July 17, 2016 (edited) Could some1 tell me how to implement those functions step by step? I'm confused.. I'm already using [BS HandleChat & GetGmLev & Party Search Fix] GameServer.exe Thanks in advance Edited July 17, 2016 by GummyBear Quote Share this post Link to post Share on other sites