Home 50 Report post Posted September 17, 2016 (edited) HOW IT WORKS STEPS 1 - Everytime a player enters a map, it saves they CURRENT GAMESERVER in a file resource/script/players/playername.txt 2 - When player leaves the map it saves the text "out" in the resource/script/players/playername.txt 3 - When the player teleports to another map the destiny will check if the playername.txt contains "out" or its gameserver name"... ... if not ... shows a message ... "GOD IS WATCHING YOU" gameserver.cfg equment = System00 gameserver1.cfg equment = System01 gameserver2.cfg equment = System02 gameserver3.cfg equment = System03 gameserver4.cfg equment = System04 Functions.lua code --> place it anywhere function GetCurrentGameServer() local ret, npc = GetEudemon() local GSName = GetChaDefaultName(npc) return GSName end function GetSavedGameServer (role) f = io.open ("resource/script/players/" .. GetChaDefaultName (role) .. ".txt", "r") SavedGameServer = f:read () f:close () return SavedGameServer end function SaveGameServer (role) local gameserver = GetCurrentGameServer() f = io.open ("resource/script/players/" .. GetChaDefaultName (role) .. ".txt", "w") f:write (gameserver) f:close () end function CleanGameServer (role) f = io.open ("resource/script/players/" .. GetChaDefaultName (role) .. ".txt", "w") f:write ("out") f:close() end all maps ctrl.lua code after enter ( Here is where you can do whatever you want if caught the trying to dupe... ) I just show a message ('God is watching you') savedGS = GetSavedGameServer(role) currentGS = GetCurrentGameServer() if (savedGS ~= "out" and savedGS ~= currentGS) then Notice("God is watching you...") end SaveGameServer(role) before leaves CleanGameServer(role) Edited September 17, 2016 by Home 9 Quote Share this post Link to post Share on other sites
Billy 164 Report post Posted September 17, 2016 Using character names as an identifier is never a good idea, since you can make a boat with that name and GetChaDefaultName(role) would return the boats name. That means you could make the system think someone else was duping, and have them be punished. You should use GetRoleID(role) instead. 2 Quote Share this post Link to post Share on other sites
Home 50 Report post Posted September 17, 2016 thanks Quote Share this post Link to post Share on other sites
Home 50 Report post Posted September 17, 2016 i'll also create an MoveCity interceptor, that will store the player destination map, and automatically teleport him when enters the source map again, after a dupe trying Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted September 18, 2016 12 часа назад, Billy сказал: Using character names as an identifier is never a good idea, since you can make a boat with that name and GetChaDefaultName(role) would return the boats name. That means you could make the system think someone else was duping, and have them be punished. You should use GetRoleID(role) instead. I think he also should use TurnToCha() function. local cha = TurnToCha(role) It will return main character descriptor even if player is in a boat. @Home Great work! 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
Home 50 Report post Posted September 18, 2016 (edited) thanks Edited September 18, 2016 by Home Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted October 17, 2017 Any way to make server kick the player if caught duping ? Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted October 17, 2017 Nevermind, figured it out, So I duped myself, and turns out the duped item isn't kept due to a function Catches the person in system so all can see I did do a finding that the item being duped, will disappear if the person puts it back in the inventory and tele's to a new place. 1 Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted October 18, 2017 int lua_FindChaClone(lua_State *pLS) { const char* useract = lua_tostring(pLS, 1); unsigned long userid = (unsigned long)lua_tonumber(pLS, 2); const char* usermap = lua_tostring(pLS, 3); BEGINGETGATE(); CPlayer *pCPlayer; CCharacter *pCha = 0; GateServer *pGateServer; while (pGateServer = GETNEXTGATE()) { if (!BEGINGETPLAYER(pGateServer)) continue; int nCount = 0; while (pCPlayer = (CPlayer*) GETNEXTPLAYER(pGateServer)) { if (nCount > GETPLAYERCOUNT(pGateServer)) break; pCha = pCPlayer->GetMainCha(); if (!pCha) continue; const char* cmpact = pCPlayer->GetActName(); if (std::strcmp(useract, cmpact) == 0) { if (userid != pCha->m_ID) g_pGameApp->ReleaseGamePlayer(pCPlayer); if (std::strcmp(usermap, pCha->GetSubMap()->GetName()) == 1) g_pGameApp->ReleaseGamePlayer(pCPlayer); } } } return 1; } Perhaps this could help someone. It was an earlier version of antidupe I did. works fine, you just need to know when and how to call it. Quote Share this post Link to post Share on other sites