function setSerialData(serial,key,value)
if( value and type(serial) == "string") then
setElementData(root,serial.."&"..key,value)
end
end
function getSerialData(serial,key)
if ( key and type(serial) == "string") then
value = getElementData(root,serial.."&"..key)
end
return value
end
addEventHandler('onResourceStart', resourceRoot,
function ()
for _,v in ipairs(getElementsByType("player")) do
f = getSerialData(v, "snhwa1" )
if (f) then
setElementData(v,"snhwa", f)
end
end
end)
addEventHandler('onPlayerQuit', root,
function ()
my = getElementData(source,"snhwa")
if (my) then
setSerialData (getPlayerSerial(source),"snhwa1",my)
end
end)