--- ID RENDSZER
local ids = {}
function assignID()
for i=1,getMaxPlayers() do
if not ids then
ids = source
setElementData(source,\"char:id\",i,not optimize)
setElementData(source,\"playerid\",i,not optimize)
break
end
end
end
addEventHandler(\"onPlayerJoin\",root,assignID)
function freeID()
local id = getElementData(source,\"char:id\")
if not id then return end
ids[id] = nil
end
addEventHandler(\"onPlayerQuit\",root,freeID)
function onPlayerNameChange()
cancelEvent()
end
addEventHandler(\"onPlayerChangeNick\", getRootElement(), onPlayerNameChange)