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)