addEventHandler ( "onPlayerLogin",root, function ( )
setTimer ( function ( source )
if ( getAccountData ( source, "jailed" ) == true ) then
randomJail = jTable[math.random(#jTable)]
if ( randomJail ) then
x,y,z = randomJail[2],randomJail[3],randomJail[4]
int = randomJail[5]
dim = randomJail[6]
setElementInterior ( source, int )
setElementDimension ( source, dim )
setElementPosition ( source, x,y,z )
end
end
end, 1000, 1, source )
end )
addEventHandler("onPlayerJoin",root, -- Check If He Is Jailed - By Serial [ OnJoin ]
function()
if getAccountData(rRoot,""..getPlayerSerial(source).."-j") == true then
randomJail = jTable[math.random(#jTable)]
if randomJail then
x,y,z = randomJail[2],randomJail[3],randomJail[4]
int = randomJail[5]
dim = randomJail[6]
setElementInterior ( source, int )
setElementDimension(source,dim)
setElementPosition (source,x,y,z )
--
time = getAccountData(rRoot,""..getPlayerSerial(source).."-t",time) or 5 * 1000
startJailTimer(source,time)
setAccountData(source,"jailed",true)
end
end
end )