magicplayerc Posted January 10, 2019 Share Posted January 10, 2019 (edited) function diminuiestrela () for _,jog in ipairs ( getElementsByType ('player') ) do local Serial = getPlayerSerial(jog) if ( getElementData (jog, 'naprisao') or getElementData (jog, 'navtr') or getElementData(ResourceEscolhido,""..Serial.."preso",true) ) then setPlayerWantedLevel (jog, getPlayerWantedLevel(jog)-1) if ( getPlayerWantedLevel (jog) < 1 ) then libera (jog) end end end if ( i == 4 ) then i = 1 else i = i +1 end end setTimer (diminuiestrela, 40000, 10000) function Logar () local Serial = getPlayerSerial(source) if getElementData(ResourceEscolhido,""..Serial.."preso",true) then outputChatBox("Você deslogou Preso, e por isso foi adicionado 6 estrelas", source) setPlayerWantedLevel ( source, 6 ) setElementInterior(source,6) setElementPosition (source, 264.1, 77.9, 1001.0) end end addEventHandler ( 'onPlayerLogin', getRootElement ( ),Logar) function onPlayerSpawn() if getElementData(source, "preso") then outputChatBox("Você deslogou Preso, e por isso foi adicionado 6 estrelas", source) setElementInterior(source,6) setElementPosition (source, 264.1, 77.9, 1001.0) end end addEventHandler("onPlayerSpawn", getRootElement, onPlayerSpawn) function onSetTime() for _, jog in pairs(getElementsByType("player")) do if ( getElementData(jog,"naprisao"..getPlayerSerial(jog).."navtr") or ( getElementData(jog, "preso") ) ) then setPlayerWantedLevel(jog, getPlayerWantedLevel(jog)-1) if ( getPlayerWantedLevel(jog) == 0 ) then Liberar(jog) end end end end setTimer(onSetTime, 60000, 0) Edited January 10, 2019 by magicplayerc Link to comment
Tommy. Posted January 11, 2019 Share Posted January 11, 2019 function quitPreso() if getElementData(source, "preso") then local account = getPlayerAccount(source) if (account) and not (isGuestAccount(account)) then setAccountData(account, "preso", true) end end end addEventHandler("onPlayerQuit", root, quitPreso) function joinPreso() local account = getPlayerAccount(source) if getAccountData(account, "preso", true) then outputChatBox("Você deslogou Preso, e por isso foi adicionado 6 estrelas", source) setPlayerWantedLevel(source, 6) setElementInterior(source,6) setElementPosition(source, 264.1, 77.9, 1001.0) setElementData(source, "preso", true) end end addEventHandler("onPlayerLogin", root, joinPreso) EDIT: Se eu entendi bem, isso deve funcionar. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now