vanessa

HUD ERRO/ SISTEMA DE LANCHONETE

Recommended Posts

Olá galera tudo bom? espero que sim, se alguém puder me ajudar com esse erro

 

eu crei uma hud porém peguei a lanchonete de um outro script so que nao to conseguindo adicionar essa loja em meu script 

 

arquivo cliente 

 

 

--[[
            BY +Kah

       POR FAVOR NAO RETIRAR OS CREDITOS !!!!!!!!!
       TODOS OS DIREITOS RESERVADO !!!!!!!!!!!!
       
       POR FAVOR NAO RETIRAR OS CREDITOS !!!!!!!!!
       TODOS OS DIREITOS RESERVADO !!!!!!!!!!!!
--]]

addEventHandler("onClientRender", root,
    function()

    local vida = getElementHealth(localPlayer)
    local colete = getPedArmor(localPlayer)
    local dinheiro = getPlayerMoney(localPlayer)
    local pente = getPedAmmoInClip(localPlayer)
    local total = getPedTotalAmmo(localPlayer)
    local nome = getPlayerName(localPlayer)
    local Sono = getElementData ( localPlayer, "AirNew:Sono" )
    local Sede = getElementData ( localPlayer, "AirNew:Sede" )
    local Fome = getElementData ( localPlayer, "AirNew:Fome" )
    local bankMoney = getElementData(localPlayer, "Bank:Caixa")
    local lvl = tonumber(getElementData(localPlayer, "Level")) or 0 
    local Trabalho = getElementData ( localPlayer, "Emprego" ) or "Desempregado"


        dxDrawImage(1035, 44, 322, 28, ":HUDNOVA01/images/carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawText(bankMoney, 1153, 49, 1237, 65, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- dinheiro d banco
        dxDrawImage(1062, 75, 297, 107, ":HUDNOVA01/images/fundo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1149, 98, 78, 22, ":HUDNOVA01/images/Vida.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) -- barra de vida 
        dxDrawImage(1149, 130, 80, 23, ":HUDNOVA01/images/Colete.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) -- barra colete 
        dxDrawText(dinheiro, 1040, 49, 1124, 65, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- dinheiro na mao 
        dxDrawText("VAGABUNDO", 1273, 49, 1357, 65, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) --trabalho
        dxDrawText( vida, 1175, 100, 1217, 120, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- porcentagem vida
        dxDrawText(colete, 1175, 133, 1217, 153, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- porcentagem colete
        dxDrawImage(1249, 98, 100, 18, ":HUDNOVA01/images/barraqualquer.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) -- barra sfome
        dxDrawImage(1249, 144, 101, 19, ":HUDNOVA01/images/barrasono.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) -- barra sono
        dxDrawImage(1249, 120, 101, 19, ":HUDNOVA01/images/Sede.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) -- barra sede
        dxDrawText("Fome", 1288, 100, 1330, 120, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- por fome 
        dxDrawText("Sede", 1288, 124, 1330, 144, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- porc sede
        dxDrawText("Sono", 1288, 144, 1330, 164, tocolor(54, 200, 102, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- por sono
        dxDrawImage(1233, 100, 16, 14, ":HUDNOVA01/images/comida.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1035, 25, 15, 14, ":HUDNOVA01/images/procurado.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawText("0", 1052, 25, 1089, 44, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- nivel procurado 
        dxDrawText("nivel", 1193, 25, 1263, 49, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- nivel
        dxDrawText("id", 1114, 25, 1198, 53, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- id
        dxDrawText("xd", 1303, 27, 1387, 55, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- xp 
        dxDrawImage(1101, 189, 48, 38, ":HUDNOVA01/icons/28.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawText("ama pente", 1091, 231, 1188, 260, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- arma e pente 
        dxDrawImage(1234, 149, 15, 13, ":HUDNOVA01/images/sono.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1233, 124, 16, 13, ":HUDNOVA01/images/bebida.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1231, 50, 18, 15, ":HUDNOVA01/images/logobanco.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1123, 51, 16, 14, ":HUDNOVA01/images/logodinheiro.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawText("data", 1185, 75, 1276, 94, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- data 
        dxDrawText("hora", 1219, 182, 1310, 201, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) -- hora
    end
 -- aqui comeca o script que eu peguei de uma outra hud 


addEventHandler("onClientRender", root, hud)


----------------------------------------------------------------------------------------------------------------------------------------

FomeTempo = 108000 -- 3 Horas
SedeTempo = 72000  -- 2 Horas
SonoTempo = 144000 -- 4 Horas
----------------------------------------------------------------------------------------------------------------------------------------

-- F O M E

----------------------------------------------------------------------------------------------------------------------------------------

local screenW,screenH = guiGetScreenSize()
local resW, resH = 1366,768
local x, y = (screenW/resW), (screenH/resH)

DinheiroInsuficiente = "[ Lanchonete ] - Dinheiro Insuficiente !"
SemFome = "[ Lanchonete ] - Você Não Esta com Fome !"
SemSede = "[ Lanchonete ] - Você Não Esta com Sede !"

XBurguerComprado = "[ Lanchonete ] - Você Pagou $13.99 Por um X-Burguer"
XSaladaComprado = "[ Lanchonete ] - Você Pagou $14.99 Por um X-Salada"
XTudoComprado = "[ Lanchonete ] - Você Pagou $20.99 Por um X-Tudo"
RefrigeranteComprado = "[ Lanchonete ] - Você Pagou $2.99 Por um Refrigerante"
PizzaDeCalabresaComprada = "[ Lanchonete ] - Você Pagou $26.99 Por uma Pizza"
PizzaDeFrangoComCatupiryComprada = "[ Lanchonete ] - Você Pagou $29.99 Por uma Pizza"

----------------------------------------------------------------------------------------------------------------------------------------

PainelLojaAirNew = false

----------------------------------------------------------------------------------------------------------------------------------------

function FomeAirNew ()
        
        dxDrawLine(x*433 - 1, y*218 - 1, x*433 - 1, y*569, tocolor(0, 0, 0, 255), x*1, false)
        dxDrawLine(x*933, y*218 - 1, x*433 - 1, y*218 - 1, tocolor(0, 0, 0, 255), x*1, false)
        dxDrawLine(x*433 - 1, y*569, x*933, y*569, tocolor(0, 0, 0, 255), x*1, false)
        dxDrawLine(x*933, y*569, x*933, y*218 - 1, tocolor(0, 0, 0, 255), x*1, false)
        dxDrawRectangle(x*432, y*218, x*501, y*352, tocolor(0, 0, 0, 59), false)
        
        dxDrawRectangle(x*433, y*218, x*500, y*36, tocolor(0, 0, 0, 105), false)
        
        if cursorPosition (x*477, y*294, x*413, y*35) then -- X-Burguer
        dxDrawRectangle(x*477, y*294, x*413, y*36, tocolor(19, 92, 167, 121), false)
        else
        dxDrawRectangle(x*477, y*294, x*413, y*36, tocolor(0, 0, 0, 97), false)
        end
        
        if cursorPosition (x*477, y*330, x*413, y*35) then -- X-Salada
        dxDrawRectangle(x*477, y*330, x*413, y*36, tocolor(19, 92, 167, 121), false)
        else
        dxDrawRectangle(x*477, y*330, x*413, y*36, tocolor(0, 0, 0, 97), false)
        end
        
        if cursorPosition (x*477, y*366, x*413, y*35) then -- X-Tudo
        dxDrawRectangle(x*477, y*366, x*413, y*36, tocolor(19, 92, 167, 121), false)
        else
        dxDrawRectangle(x*477, y*366, x*413, y*36, tocolor(0, 0, 0, 97), false)
        end
        
        if cursorPosition (x*477, y*402, x*413, y*35) then -- Refrigerante
        dxDrawRectangle(x*477, y*402, x*413, y*36, tocolor(19, 92, 167, 121), false)
        else
        dxDrawRectangle(x*477, y*402, x*413, y*36, tocolor(0, 0, 0, 97), false)
        end
        
        if cursorPosition (x*477, y*438, x*413, y*35) then -- Pizza de Calabresa
        dxDrawRectangle(x*477, y*438, x*413, y*36, tocolor(19, 92, 167, 121), false)
        else
        dxDrawRectangle(x*477, y*438, x*413, y*36, tocolor(0, 0, 0, 97), false)
        end
        
        if cursorPosition (x*477, y*474, x*413, y*35) then -- Pizza de Frango com Catupiry
        dxDrawRectangle(x*477, y*474, x*413, y*36, tocolor(19, 92, 167, 121), false)
        else
        dxDrawRectangle(x*477, y*474, x*413, y*36, tocolor(0, 0, 0, 97), false)
        end
        
        dxDrawText("X-Burguer", x*497, y*294, x*784, y*330, tocolor(255, 255, 255, 255), x*1.00, "arial", "left", "center", false, false, false, false, false)
        dxDrawText("$ 13.99", x*784, y*294, x*890, y*330, tocolor(255, 255, 255, 255), x*1.00, "arial", "center", "center", false, false, false, false, false)
        
        dxDrawText("Lanchonete", x*433 + 1, y*218 + 1, x*933 + 1, y*254 + 1, tocolor(0, 0, 0, 255), x*1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Lanchonete", x*433, y*218, x*933, y*254, tocolor(255, 255, 255, 255), x*1.00, "default-bold", "center", "center", false, false, false, false, false)

        dxDrawText("X-Salada", x*497, y*330, x*784, y*366, tocolor(255, 255, 255, 255), x*1.00, "arial", "left", "center", false, false, false, false, false)
        dxDrawText("$ 14.99", x*784, y*330, x*890, y*366, tocolor(255, 255, 255, 255), x*1.00, "arial", "center", "center", false, false, false, false, false)
        
        dxDrawText("X-Tudo", x*497, y*366, x*784, y*402, tocolor(255, 255, 255, 255), x*1.00, "arial", "left", "center", false, false, false, false, false)
        dxDrawText("$ 20.99", x*784, y*366, x*890, y*402, tocolor(255, 255, 255, 255), x*1.00, "arial", "center", "center", false, false, false, false, false)
        
        dxDrawText("Refrigerante", x*497, y*402, x*784, y*438, tocolor(255, 255, 255, 255), x*1.00, "arial", "left", "center", false, false, false, false, false)
        dxDrawText("$ 2.99", x*784, y*402, x*890, y*438, tocolor(255, 255, 255, 255), x*1.00, "arial", "center", "center", false, false, false, false, false)
        
        dxDrawText("Pizza de Calabresa", x*497, y*438, x*784, y*474, tocolor(255, 255, 255, 255), x*1.00, "arial", "left", "center", false, false, false, false, false)
        dxDrawText("$ 26.99", x*784, y*438, x*890, y*474, tocolor(255, 255, 255, 255), x*1.00, "arial", "center", "center", false, false, false, false, false)
        
        dxDrawText("Pizza de Frango com Catupiry", x*497, y*474, x*784, y*510, tocolor(255, 255, 255, 255), x*1.00, "arial", "left", "center", false, false, false, false, false)
        dxDrawText("$ 29.99", x*784, y*474, x*890, y*510, tocolor(255, 255, 255, 255), x*1.00, "arial", "center", "center", false, false, false, false, false)
        
        dxDrawRectangle(x*903, y*226, x*19, y*20, tocolor(255, 255, 255, 0), false) -- Fechar
        
        if cursorPosition (x*903, y*226, x*19, y*20) then
        dxDrawText("X", x*892, y*218, x*933, y*254, tocolor(19, 92, 167, 255), x*1.00, "default-bold", "center", "center", false, false, false, false, false)
        else
        dxDrawText("X", x*892, y*218, x*933, y*254, tocolor(255, 255, 255, 255), x*1.00, "default-bold", "center", "center", false, false, false, false, false)
        end
        
        dxDrawText("Clique em um dos Itens para Realizar uma Compra!", x*433 + 1, y*526 + 1, x*933 + 1, y*564 + 1, tocolor(0, 0, 0, 255), x*1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Clique em um dos Itens para Realizar uma Compra!", x*433, y*526, x*933, y*564, tocolor(255, 255, 255, 255), x*1.00, "default-bold", "center", "center", false, false, false, false, false)

end


----------------------------------------------------------------------------------------------------------------------------------------

function AbrirPainelLoja ()
if PainelLojaAirNew == false then
addEventHandler ( "onClientRender", root, FomeAirNew )
showCursor ( true )
PainelLojaAirNew = true
end
end
addEvent ( "Abrir:PainelLojaAirNew", true)
addEventHandler ( "Abrir:PainelLojaAirNew", root, AbrirPainelLoja )

function FecharPainelLoja ()
if PainelLojaAirNew == true then
removeEventHandler ( "onClientRender", root, FomeAirNew )
showCursor ( false )
PainelLojaAirNew = false
playSoundFrontEnd ( 40 )
end
end
addEvent ( "Fechar:PainelLojaAirNew", true)
addEventHandler ( "Fechar:PainelLojaAirNew", root, FecharPainelLoja )

----------------------------------------------------------------------------------------------------------------------------------------

function FecharXLoja (_,state)
if PainelLojaAirNew == true then
if state == "down" then
if isCursorOnElement ( x*903, y*226, x*19, y*20 ) then
removeEventHandler ( "onClientRender", root, FomeAirNew )
showCursor ( false )
PainelLojaAirNew = false
playSoundFrontEnd ( 40 )
end
end
end
end
addEventHandler ( "onClientClick", root, FecharXLoja )

function ObjetosDaLoja (_,state)

if PainelLojaAirNew == true then
if state == "down" then

local Sede = getElementData ( localPlayer, "AirNew:Sede" )
local Fome = getElementData ( localPlayer, "AirNew:Fome" )
local Dinheiro = getPlayerMoney ( localPlayer )

if isCursorOnElement ( x*477, y*294, x*413, y*35 ) then -- X-Burguer

if Fome == 100 then

playSoundFrontEnd ( 40 ) 
outputChatBox (SemFome, 255, 255, 255, true)

return end

if Dinheiro >= 14 then
triggerServerEvent ( "AirNew>RemoverDinheiro01", localPlayer )

outputChatBox (XBurguerComprado, 255, 255, 255, true)

setElementData ( localPlayer, "AirNew:Fome", Fome+5 )
playSoundFrontEnd ( 40 )

else

outputChatBox (DinheiroInsuficiente, 255, 255, 255, true)
playSoundFrontEnd ( 40 )

end
end

if isCursorOnElement ( x*477, y*330, x*413, y*35 ) then -- X-Salada

if Fome == 100 then

playSoundFrontEnd ( 40 ) 
outputChatBox (SemFome, 255, 255, 255, true)

return end

if Dinheiro >= 15 then
triggerServerEvent ( "AirNew>RemoverDinheiro02", localPlayer )

outputChatBox (XSaladaComprado, 255, 255, 255, true)

setElementData ( localPlayer, "AirNew:Fome", Fome+10 )
playSoundFrontEnd ( 40 )

else

outputChatBox (DinheiroInsuficiente, 255, 255, 255, true)
playSoundFrontEnd ( 40 )

end
end

if isCursorOnElement ( x*477, y*366, x*413, y*35 ) then -- X-Tudo

if Fome == 100 then

playSoundFrontEnd ( 40 ) 
outputChatBox (SemFome, 255, 255, 255, true)

return end

if Dinheiro >= 21 then
triggerServerEvent ( "AirNew>RemoverDinheiro03", localPlayer )

outputChatBox (XTudoComprado, 255, 255, 255, true)

setElementData ( localPlayer, "AirNew:Fome", Fome+15 )
playSoundFrontEnd ( 40 )

else

outputChatBox (DinheiroInsuficiente, 255, 255, 255, true)
playSoundFrontEnd ( 40 )

end
end

if isCursorOnElement ( x*477, y*402, x*413, y*35 ) then -- Refrigerante

if Sede == 100 then

playSoundFrontEnd ( 40 ) 
outputChatBox (SemSede, 255, 255, 255, true)

return end

if Dinheiro >= 3 then
triggerServerEvent ( "AirNew>RemoverDinheiro04", localPlayer )

outputChatBox (RefrigeranteComprado, 255, 255, 255, true)

setElementData ( localPlayer, "AirNew:Sede", Sede+20 )
playSoundFrontEnd ( 40 )

else

outputChatBox (DinheiroInsuficiente, 255, 255, 255, true)
playSoundFrontEnd ( 40 )

end
end

if isCursorOnElement ( x*477, y*438, x*413, y*35 ) then -- Pizza de Calabresa

if Fome == 100 then

playSoundFrontEnd ( 40 ) 
outputChatBox (SemFome, 255, 255, 255, true)

return end

if Dinheiro >= 27 then
triggerServerEvent ( "AirNew>RemoverDinheiro05", localPlayer )

outputChatBox (PizzaDeCalabresaComprada, 255, 255, 255, true)

setElementData ( localPlayer, "AirNew:Fome", Fome+30 )
playSoundFrontEnd ( 40 )

else

outputChatBox (DinheiroInsuficiente, 255, 255, 255, true)
playSoundFrontEnd ( 40 )

end
end

if isCursorOnElement ( x*477, y*474, x*413, y*35 ) then -- Pizza de Frango com Catupiry

if Fome == 100 then

playSoundFrontEnd ( 40 ) 
outputChatBox (SemFome, 255, 255, 255, true)

return end

if Dinheiro >= 30 then
triggerServerEvent ( "AirNew>RemoverDinheiro06", localPlayer )

outputChatBox (PizzaDeFrangoComCatupiryComprada, 255, 255, 255, true)

setElementData ( localPlayer, "AirNew:Fome", Fome+50 )
playSoundFrontEnd ( 40 )

else

outputChatBox (DinheiroInsuficiente, 255, 255, 255, true)
playSoundFrontEnd ( 40 )

end
end

end
end
end
addEventHandler ( "onClientClick", root, ObjetosDaLoja )

----------------------------------------------------------------------------------------------------------------------------------------

function FomeRepeat()

if getElementData ( localPlayer, "afkdate" ) == true then return end

if getElementData ( localPlayer, "Fome:Logado" ) == true then

Fome = getElementData ( localPlayer, "AirNew:Fome" ) -1
SetarFome = setElementData ( localPlayer, "AirNew:Fome", Fome )

if Fome <= 0 then
 setElementData ( localPlayer, "AirNew:Fome", 10 )
 setElementHealth ( localPlayer, 0 )
 outputChatBox ( "[ Fome ] - Você Morreu de Fome", 255, 255, 255, true )
 outputChatBox ( "[ Fome ] - Vá Até uma Lanchonete e Coma Algo, ou Você Vai Morrer Novamente", 255, 255, 255, true )
end

if Fome == 15 then
  outputChatBox ( "[ Fome ] - Você Esta com Fome e Precisa Comer", 255, 255, 255, true )
  outputChatBox ( "[ Fome ] - Vá Até uma Lanchonete e Coma Algo, ou Você Vai Morrer de Fome", 255, 255, 255, true )
  playSoundFrontEnd ( 45 )
end

if Fome == 10 then
  outputChatBox ( "[ Fome ] - Você Esta com Fome e Precisa Comer", 255, 255, 255, true )
  outputChatBox ( "[ Fome ] - Vá Até uma Lanchonete e Coma Algo, ou Você Vai Morrer de Fome", 255, 255, 255, true )
  playSoundFrontEnd ( 45 )
end

if Fome == 5 then
  outputChatBox ( "[ Fome ] - Você Esta com Fome e Precisa Comer", 255, 255, 255, true )
  outputChatBox ( "[ Fome ] - Vá Até uma Lanchonete e Coma Algo, ou Você Vai Morrer de Fome", 255, 255, 255, true )
  playSoundFrontEnd ( 45 )
end

end
end
setTimer(FomeRepeat,FomeTempo,0)

----------------------------------------------------------------------------------------------------------------------------------------

function VerificarFomeRepeat ()

if getElementData ( localPlayer, "Fome:Logado" ) == true then

Fome = getElementData ( localPlayer, "AirNew:Fome" )

if Fome > 100 then
setElementData ( localPlayer, "AirNew:Fome", 100 )

end
end
end
setTimer(VerificarFomeRepeat,50,0)

----------------------------------------------------------------------------------------------------------------------------------------

function cursorPosition(x, y, width, height)
    if (not isCursorShowing()) then
        return false
    end
    local sx, sy = guiGetScreenSize()
    local cx, cy = getCursorPosition()
    local cx, cy = (cx*sx), (cy*sy)
    if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then
        return true
    else
        return false
    end
end

----------------------------------------------------------------------------------------------------------------------------------------

function isCursorOnElement( x,y,w,h )
local mx,my = getCursorPosition ()
local fullx,fully = guiGetScreenSize()
cursorx,cursory = mx*fullx,my*fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end

----------------------------------------------------------------------------------------------------------------------------------------

-- S E D E

----------------------------------------------------------------------------------------------------------------------------------------

function SedeRepeat()

if getElementData ( localPlayer, "afkdate" ) == true then return end

if getElementData ( localPlayer, "Sede:Logado" ) == true then

Sede = getElementData ( localPlayer, "AirNew:Sede" ) -1
SetarSede = setElementData ( localPlayer, "AirNew:Sede", Sede )

if Sede <= 0 then
 setElementData ( localPlayer, "AirNew:Sede", 10 )
 setElementHealth ( localPlayer, 0 )
 outputChatBox ( "[ Sede ] - Você Morreu de Sede", 255, 255, 255, true )
 outputChatBox ( "[ Sede ] - Vá Até uma Lanchonete e Beba Algo, ou Você Vai Morrer Novamente", 255, 255, 255, true )
end

if Sede == 15 then
  outputChatBox ( "[ Sede ] - Você Esta com Sede e Precisa Comer", 255, 255, 255, true )
  outputChatBox ( "[ Sede ] - Vá Até uma Lanchonete e Beba Algo, ou Você Vai Morrer de Sede", 255, 255, 255, true )
  playSoundFrontEnd ( 45 )
end

if Sede == 10 then
  outputChatBox ( "[ Sede ] - Você Esta com Sede e Precisa Comer", 255, 255, 255, true )
  outputChatBox ( "[ Sede ] - Vá Até uma Lanchonete e Beba Algo, ou Você Vai Morrer de Sede", 255, 255, 255, true )
  playSoundFrontEnd ( 45 )
end

if Sede == 5 then
  outputChatBox ( "[ Sede ] - Você Esta com Sede e Precisa Comer", 255, 255, 255, true )
  outputChatBox ( "[ Sede ] - Vá Até uma Lanchonete e Beba Algo, ou Você Vai Morrer de Sede", 255, 255, 255, true )
  playSoundFrontEnd ( 45 )
end

end
end
setTimer(SedeRepeat,SedeTempo,0)

----------------------------------------------------------------------------------------------------------------------------------------

function VerificarSedeRepeat ()

if getElementData ( localPlayer, "Sede:Logado" ) == true then

Sede = getElementData ( localPlayer, "AirNew:Sede" )

if Sede > 100 then
setElementData ( localPlayer, "AirNew:Sede", 100 )

end
end
end
setTimer(VerificarSedeRepeat,50,0)

----------------------------------------------------------------------------------------------------------------------------------------

-- S O N O

----------------------------------------------------------------------------------------------------------------------------------------

TempoDesmaiado = 10000 -- 10 Segundos ( Trocar no Server.Lua Tambem )
TempoDormir = 5000 -- 5 Segundos ( Trocar no Server.Lua Tambem )

----------------------------------------------------------------------------------------------------------------------------------------

setElementData ( localPlayer, "AirNew:Dormindo", false )

----------------------------------------------------------------------------------------------------------------------------------------

local screenW, screenH = guiGetScreenSize()
local resW, resH = 1366,768
local x, y = (screenW/resW), (screenH/resH)

----------------------------------------------------------------------------------------------------------------------------------------

function SonoRepeat()

if getElementData ( localPlayer, "afkdate" ) == true then return end

if getElementData ( localPlayer, "Sono:Logado" ) == true then

Sono = getElementData ( localPlayer, "AirNew:Sono" ) -1
SetarSono = setElementData ( localPlayer, "AirNew:Sono", Sono )

if Sono <= 0 then
 setElementData ( localPlayer, "AirNew:Sono", 10 )
 setElementData ( localPlayer, "AirNew:Dormindo", true )
 
 triggerServerEvent ( "AirNew>RoubarDesmaiado", localPlayer )

 toggleAllControls ( false )
 
 setTimer ( setElementData, TempoDesmaiado, 1, localPlayer, "AirNew:Dormindo", false )
 setTimer ( setElementData, TempoDesmaiado, 1, localPlayer, "AirNew:Sono", 10 )
 setTimer ( outputChatBox, TempoDesmaiado, 1, "[ Dormir ] - Você Acordou de um Desmaio !", 255, 255, 255, true )
 setTimer ( outputChatBox, TempoDesmaiado, 1, "[ Dormir ] - Você Precisa Dormir ou Vai Acabar Desmaiando Novamente !", 255, 255, 255, true )
 setTimer ( toggleAllControls, TempoDesmaiado, 1, true )
 setTimer ( playSoundFrontEnd, TempoDesmaiado, 1, 45 )
end

if Sono == 15 then
  outputChatBox ( "[ Dormir ] - Você Esta com Sono e Precisa Dormir", 255, 255, 255, true )
  outputChatBox ( "[ Dormir ] - Entre em um Caminhão ou Em uma Casa e Digite /Dormir", 255, 255, 255, true )
  playSoundFrontEnd ( 45 )
end

if Sono == 10 then
  outputChatBox ( "[ Dormir ] - Você Esta com Sono e Precisa Dormir", 255, 255, 255, true )
  outputChatBox ( "[ Dormir ] - Entre em um Caminhão ou Em uma Casa e Digite /Dormir", 255, 255, 255, true )
  playSoundFrontEnd ( 45 )
end

if Sono == 5 then
  outputChatBox ( "[ Dormir ] - Você Esta com Sono e Precisa Dormir", 255, 255, 255, true )
  outputChatBox ( "[ Dormir ] - Entre em um Caminhão ou Em uma Casa e Digite /Dormir", 255, 255, 255, true )
  playSoundFrontEnd ( 45 )
end

end
end
setTimer(SonoRepeat,SonoTempo,0)

----------------------------------------------------------------------------------------------------------------------------------------

function VerificarEstadoSono ()

if getElementData ( localPlayer, "Sono:Logado" ) == true then

Sono = getElementData ( localPlayer, "AirNew:Sono" )

if Sono <= 50 then
  setElementData ( localPlayer, "AirNew:LiberarComando", true )
 else
  setElementData ( localPlayer, "AirNew:LiberarComando", false )
end

if Sono > 100 then
  setElementData ( localPlayer, "AirNew:Sono", 100 )
end

end
end
setTimer(VerificarEstadoSono,50,0)

----------------------------------------------------------------------------------------------------------------------------------------

function BarraSono ()
  if getElementData ( localPlayer, "AirNew:Dormindo" ) == true then
  dxDrawRectangle((screenW - x*1366) / 2, (screenH - y*768) / 2, x*1366, y*768, tocolor(0, 0, 0, 255), false) 
  dxDrawText("Dormindo...", x*0 + 1, y*0 + 1, x*1366 + 1, y*768 + 1, tocolor(0, 0, 0, 255), x*2.00, "pricedown", "center", "center", false, false, false, false, false)
  dxDrawText("Dormindo...", (screenW - x*1366) / 2, (screenH - y*768) / 2, ((screenW - x*1366) / 2) + 1366, ( (screenH - y*768) / 2) + 768, tocolor(81, 166, 244, 255), x*2.00, "pricedown", "center", "center", false, false, false, false, false)
end  
end
addEventHandler ("onClientRender", root, BarraSono)

-- aqui termina 

)
--- script do arquivo cliente 

 

 

-- arquivo server 

 

--[[

 ################################################
 #                                              #
 #              Script Criado Por               #
 #           FACEBOOK.COM/AIRNEWSCR             #
 #           Down Liberado > NeverZ <         #
 #                                              #
 ################################################
 


--]]

----------------------------------------------------------------------------------------------------------------------------------------

-- F O M E

----------------------------------------------------------------------------------------------------------------------------------------

-- True = Ligado
-- False = Desligado

Fome01 = true -- Marker 01
Fome02 = true -- Marker 02
Fome03 = false -- Marker 03
Fome04 = false -- Marker 04
Fome05 = false -- Marker 05
Fome06 = false -- Marker 06
Fome07 = false -- Marker 07
Fome08 = false -- Marker 08
Fome09 = false -- Marker 09
Fome10 = false -- Marker 10

-- Se Você quiser Colocar +1 Marker coloque True no Numero conforme o Marker

local RF = 20
local GF = 70
local BF = 230
local AlphaF = 95
local TamanhoMK = 1.2

if Fome01 == true then
MarkersFome = createMarker ( 370.93375, -6.48615, 1001.85889 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 01
setElementDimension( MarkersFome, 0 )
setElementInterior ( MarkersFome, 9 )
end

if Fome02 == true then
MarkersFome2 = createMarker ( -787.98914, 500.49689, 1371.74219 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 02
setElementDimension( MarkersFome2, 0 )
setElementInterior ( MarkersFome2, 1 )
end

if Fome03 == true then
MarkersFome3 = createMarker ( 0, 0, 0 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 03
setElementDimension( MarkersFome3, 0 )
setElementInterior ( MarkersFome3, 0 )
end

if Fome04 == true then
MarkersFome4 = createMarker ( 0, 0, 0 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 04
setElementDimension( MarkersFome4, 0 )
setElementInterior ( MarkersFome4, 0 )
end

if Fome05 == true then
MarkersFome5 = createMarker ( 0, 0, 0 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 05
setElementDimension( MarkersFome5, 0 )
setElementInterior ( MarkersFome5, 0 )
end

if Fome06 == true then
MarkersFome6 = createMarker ( 0, 0, 0 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 06
setElementDimension( MarkersFome6, 0 )
setElementInterior ( MarkersFome6, 0 )
end

if Fome07 == true then
MarkersFome7 = createMarker ( 0, 0, 0 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 07
setElementDimension( MarkersFome7, 0 )
setElementInterior ( MarkersFome7, 0 )
end

if Fome08 == true then
MarkersFome8 = createMarker ( 0, 0, 0 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 08
setElementDimension( MarkersFome8, 0 )
setElementInterior ( MarkersFome8, 0 )
end

if Fome09 == true then
MarkersFome9 = createMarker ( 0, 0, 0 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 09
setElementDimension( MarkersFome9, 0 )
setElementInterior ( MarkersFome9, 0 )
end

if Fome10 == true then
MarkersFome10 = createMarker ( 0, 0, 0 -1, "cylinder", TamanhoMK, RF, GF, BF, AlphaF ) -- Marker 10
setElementDimension( MarkersFome10, 0 )
setElementInterior ( MarkersFome10, 0 )
end

----------------------------------------------------------------------------------------------------------------------------------------

function RemoverDinheiro01 ()
 takePlayerMoney ( source, 14 )
end
addEvent( "AirNew>RemoverDinheiro01", true )
addEventHandler( "AirNew>RemoverDinheiro01", root, RemoverDinheiro01 )

function RemoverDinheiro02 ()
 takePlayerMoney ( source, 15 )
end
addEvent( "AirNew>RemoverDinheiro02", true )
addEventHandler( "AirNew>RemoverDinheiro02", root, RemoverDinheiro02 )

function RemoverDinheiro03 ()
 takePlayerMoney ( source, 21 )
end
addEvent( "AirNew>RemoverDinheiro03", true )
addEventHandler( "AirNew>RemoverDinheiro03", root, RemoverDinheiro03 )

function RemoverDinheiro04 ()
 takePlayerMoney ( source, 21 )
end
addEvent( "AirNew>RemoverDinheiro04", true )
addEventHandler( "AirNew>RemoverDinheiro04", root, RemoverDinheiro04 )

function RemoverDinheiro05 ()
 takePlayerMoney ( source, 27 )
end
addEvent( "AirNew>RemoverDinheiro05", true )
addEventHandler( "AirNew>RemoverDinheiro05", root, RemoverDinheiro05 )

function RemoverDinheiro06 ()
 takePlayerMoney ( source, 30 )
end
addEvent( "AirNew>RemoverDinheiro06", true )
addEventHandler( "AirNew>RemoverDinheiro06", root, RemoverDinheiro06 )

----------------------------------------------------------------------------------------------------------------------------------------

if Fome01 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

if Fome02 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome2, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome2, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

if Fome03 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome3, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome3, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

if Fome04 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome4, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome4, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

if Fome05 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome5, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome5, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

if Fome06 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome6, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome6, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

if Fome07 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome7, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome7, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

if Fome08 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome8, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome8, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

if Fome09 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome9, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome9, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

if Fome10 == true then
function EntrarNoMarkerMsgFome ( hitElement, matchingDimension )    
    if isPedInVehicle ( hitElement ) then return end
    setElementData ( hitElement, "AirNew:NoMarker", true )
    triggerClientEvent ( hitElement, "Abrir:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerHit", MarkersFome10, EntrarNoMarkerMsgFome )

function SairDoMarkerMsgFome ( leaveElement, matchingDimension )
    if isPedInVehicle ( leaveElement ) then return end
    setElementData ( leaveElement, "AirNew:NoMarker", false )
    triggerClientEvent ( leaveElement, "Fechar:PainelLojaAirNew", root)
end
addEventHandler( "onMarkerLeave", MarkersFome10, SairDoMarkerMsgFome )
end

----------------------------------------------------------------------------------------------------------------------------------------

function deslogar(acc)
    cancelEvent ()
end
addEventHandler("onPlayerLogout",getRootElement(),deslogar)

----------------------------------------------------------------------------------------------------------------------------------------

addEventHandler ("onPlayerLogin",root,function(_,Acc)
local FomeAcc2 = getAccountData ( Acc, "AirNew:Fome" )
  if FomeAcc2 == false then
   setElementData (source, "AirNew:Fome", 100)
   setElementData (source, "Fome:Logado", true)
   else
   setElementData (source, "AirNew:Fome", FomeAcc2 )
   setElementData (source, "Fome:Logado", true)
end
end)

----------------------------------------------------------------------------------------------------------------------------------------

function saveAccountDataFome ( account )
if isGuestAccount ( account ) then return false end
Player = getAccountPlayer (account)
Fomes = getElementData (Player, "AirNew:Fome" )
setAccountData (account,"AirNew:Fome",Fomes)
end

----------------------------------------------------------------------------------------------------------------------------------------

addEventHandler ( 'onPlayerQuit', root, function ( )
    local acc = getPlayerAccount ( source )
    saveAccountDataFome ( acc )
end )

----------------------------------------------------------------------------------------------------------------------------------------

addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), function( )        
 for _, plr in pairs( getElementsByType( "player" ) ) do 
 local Acc = getPlayerAccount (plr)
    if not isGuestAccount (Acc) then
    local FomeAcc = getAccountData (Acc,"AirNew:Fome")
        if FomeAcc == false then
        setElementData (plr,"AirNew:Fome",100)
        setElementData (plr, "Fome:Logado", true)
        else
        setElementData (plr,"AirNew:Fome",FomeAcc)
        setElementData (plr, "Fome:Logado", true)
        end
    end    
 end
 end)
 
----------------------------------------------------------------------------------------------------------------------------------------
 
addEventHandler ("onResourceStop",getResourceRootElement( getThisResource()),function()
for index,players in ipairs(getElementsByType("player")) do 
 local acc = getPlayerAccount ( players )
 saveAccountDataFome ( acc )
end
end)

----------------------------------------------------------------------------------------------------------------------------------------

-- S E D E

----------------------------------------------------------------------------------------------------------------------------------------

addEventHandler ("onPlayerLogin",root,function(_,Acc)
local SedeAcc2 = getAccountData ( Acc, "AirNew:Sede" )
  if SedeAcc2 == false then
   setElementData (source, "AirNew:Sede", 100)
   setElementData (source, "Sede:Logado", true)
   else
   setElementData (source, "AirNew:Sede", SedeAcc2 )
   setElementData (source, "Sede:Logado", true)
end
end)

----------------------------------------------------------------------------------------------------------------------------------------

function saveAccountDataSede ( account )
if isGuestAccount ( account ) then return false end
Player = getAccountPlayer (account)
Sedes = getElementData (Player, "AirNew:Sede" )
setAccountData (account,"AirNew:Sede",Sedes)
end

----------------------------------------------------------------------------------------------------------------------------------------

addEventHandler ( 'onPlayerQuit', root, function ( )
    local acc = getPlayerAccount ( source )
    saveAccountDataSede ( acc )
end )

----------------------------------------------------------------------------------------------------------------------------------------

addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), function( )        
 for _, plr in pairs( getElementsByType( "player" ) ) do 
 local Acc = getPlayerAccount (plr)
    if not isGuestAccount (Acc) then
    local SedeAcc = getAccountData (Acc,"AirNew:Sede")
        if SedeAcc == false then
        setElementData (plr,"AirNew:Sede",100)
        setElementData (plr, "Sede:Logado", true)
        else
        setElementData (plr,"AirNew:Sede",SedeAcc)
        setElementData (plr, "Sede:Logado", true)
        end
    end    
 end
 end)
 
----------------------------------------------------------------------------------------------------------------------------------------
 
addEventHandler ("onResourceStop",getResourceRootElement( getThisResource()),function()
for index,players in ipairs(getElementsByType("player")) do 
 local acc = getPlayerAccount ( players )
 saveAccountDataSede ( acc )
end
end)

----------------------------------------------------------------------------------------------------------------------------------------

-- S O N O

----------------------------------------------------------------------------------------------------------------------------------------

ValorParaDormir = 100
TempoDesmaiado = 10000 -- 10 Segundos ( Trocar no Client.Lua Tambem )
TempoDormir = 5000 -- 5 Segundos  ( Trocar no Client.Lua Tambem )
MensagemDormir = "[ Dormir ] - Digite /Dormir Para Deitar na Cama, Valor $100"

----------------------------------------------------------------------------------------------------------------------------------------

local R = 100
local G = 240
local B = 10
local Alpha = 50

MarkersDormir = createMarker ( 2237.60327, -1154.80420, 1029.79688 -1, "cylinder", 1.2, R, G, B, Alpha )
setElementDimension( MarkersDormir, 0 )
setElementInterior( MarkersDormir, 15 )

MarkersDormir2 = createMarker ( 2251.09009, -1158.48267, 1029.79688 -1, "cylinder", 1.2, R, G, B, Alpha )
setElementDimension( MarkersDormir2, 0 )
setElementInterior( MarkersDormir2, 15 )

MarkersDormir3 = createMarker ( 2237.59424, -1165.65015, 1029.79688 -1, "cylinder", 1.2, R, G, B, Alpha )
setElementDimension( MarkersDormir3, 0 )
setElementInterior( MarkersDormir3, 15 )

MarkersDormir4 = createMarker ( 2230.35449, -1184.99915, 1029.79688 -1, "cylinder", 1.2, R, G, B, Alpha )
setElementDimension( MarkersDormir4, 0 )
setElementInterior( MarkersDormir4, 15 )

MarkersDormir5 = createMarker ( 2204.83496, -1192.26233, 1029.79688 -1, "cylinder", 1.2, R, G, B, Alpha )
setElementDimension( MarkersDormir5, 0 )
setElementInterior( MarkersDormir5, 15 )

MarkersDormir6 = createMarker ( 2196.73730, -1177.74097, 1029.80432 -1, "cylinder", 1.2, R, G, B, Alpha )
setElementDimension( MarkersDormir6, 0 )
setElementInterior( MarkersDormir6, 15 )

MarkersDormir7 = createMarker ( 2196.85303, -1161.53381, 1029.79688 -1, "cylinder", 1.2, R, G, B, Alpha )
setElementDimension( MarkersDormir7, 0 )
setElementInterior( MarkersDormir7, 15 )

MarkersDormir8 = createMarker ( 2189.48853, -1152.31982, 1029.79688 -1, "cylinder", 1.2, R, G, B, Alpha )
setElementDimension( MarkersDormir8, 0 )
setElementInterior( MarkersDormir8, 15 )

----------------------------------------------------------------------------------------------------------------------------------------

function DormirNoMarker ( source )

if not getElementData ( source, "AirNew:LiberarComando" ) == true then outputChatBox ( "[ Dormir ] - Você Não esta Com Sono", source, 255, 255, 255, true ) return end
if getElementData ( source, "AirNew:Dormindo" ) == true then outputChatBox ( "[ Dormir ] - Você Ja esta Dormindo", source, 255, 255, 255, true ) return end

local iEW = isElementWithinMarker

local money = getPlayerMoney(source)
if money < ValorParaDormir then outputChatBox ( "[ Dormir ] - Dinheiro Insuficiente", source, 255, 255, 255, true ) return end
takePlayerMoney ( source, ValorParaDormir )

if iEW ( source, MarkersDormir ) then
ExeDormir ( source )
setElementPosition ( source, 2235.94873, -1154.69507, 1030.49426 )
setElementRotation ( source, 0, 0, 90)
setTimer ( setElementPosition, TempoDormir, 1, source, 2237.60327, -1154.80420, 1029.79688 )
end

if iEW ( source, MarkersDormir2 ) then
ExeDormir ( source )
setElementPosition ( source, 2252.91260, -1158.35510, 1030.44104 )
setElementRotation ( source, 0, 0, 90)
setTimer ( setElementPosition, TempoDormir, 1, source, 2251.09009, -1158.48267, 1029.79688 )
end

if iEW ( source, MarkersDormir3 ) then
ExeDormir ( source )
setElementPosition ( source, 2236.02246, -1165.37793, 1030.49426 )
setElementRotation ( source, 0, 0, 90)
setTimer ( setElementPosition, TempoDormir, 1, source, 2237.59424, -1165.65015, 1029.79688 )
end

if iEW ( source, MarkersDormir4 ) then
ExeDormir ( source )
setElementPosition ( source, 2230.88843, -1183.34521, 1030.52490 )
setElementRotation ( source, 0, 0, 0 )
setTimer ( setElementPosition, TempoDormir, 1, source, 2230.35449, -1184.99915, 1029.79688 )
end

if iEW ( source, MarkersDormir5 ) then
ExeDormir ( source )
setElementPosition ( source, 2204.31152, -1193.93835, 1030.52490 )
setElementRotation ( source, 0, 0, 180 )
setTimer ( setElementPosition, TempoDormir, 1, source, 2204.83496, -1192.26233, 1029.79688 )
end

if iEW ( source, MarkersDormir6 ) then
ExeDormir ( source )
setElementPosition ( source, 2198.53662, -1178.55664, 1030.49426 )
setElementRotation ( source, 0, 0, 270 )
setTimer ( setElementPosition, TempoDormir, 1, source, 2196.73730, -1177.74097, 1029.80432 )
end

if iEW ( source, MarkersDormir7 ) then
ExeDormir ( source )
setElementPosition ( source, 2198.47559, -1162.45532, 1030.49426 )
setElementRotation ( source, 0, 0, 270 )
setTimer ( setElementPosition, TempoDormir, 1, source, 2196.85303, -1161.53381, 1029.79688 )
end

if iEW ( source, MarkersDormir8 ) then
ExeDormir ( source )
setElementPosition ( source, 2187.92554, -1151.83484, 1030.49426 )
setElementRotation ( source, 0, 0, 90 )
setTimer ( setElementPosition, TempoDormir, 1, source, 2189.48853, -1152.31982, 1029.79688 )
end
end
addCommandHandler ( "dormir", DormirNoMarker )

----------------------------------------------------------------------------------------------------------------------------------------

function ExeDormir ( source )

setTimer ( setPedAnimation, 200, 1, source, "CRACK", "crckidle2" )

setElementData ( source, "AirNew:Sono", 100 )
setElementData ( source, "AirNew:Dormindo", true )
setElementData ( source, "AirNew:LiberarComando", false )

toggleAllControls ( source, false )

setTimer ( setElementData, TempoDormir, 1, source, "AirNew:Dormindo", false )
setTimer ( setElementData, TempoDormir, 1, source, "AirNew:Sono", 100 )
setTimer ( outputChatBox, TempoDormir, 1, "[ Dormir ] - Você Acordou !", source, 255, 255, 255, true )
setTimer ( toggleAllControls, TempoDormir, 1, source, true )
setTimer ( setPedAnimation, TempoDormir, 1, source, false )

end

----------------------------------------------------------------------------------------------------------------------------------------

function DesmaiouVacilou ()

local DinheiroPerdido = math.random(500,700)
takePlayerMoney ( source, DinheiroPerdido )
setTimer ( outputChatBox, TempoDesmaiado, 1, "[ Dormir ] - Você Desmaiou e Foi Roubado. Valor Perdido -$" .. DinheiroPerdido .. "", source, 255, 255, 255, true )

end
addEvent ("AirNew>RoubarDesmaiado",true) 
addEventHandler ("AirNew>RoubarDesmaiado", root, DesmaiouVacilou )

----------------------------------------------------------------------------------------------------------------------------------------

function EntrarNoMarkerMsgDormir ( hitElement, matchingDimension )
    if isPedInVehicle ( hitElement ) then return end
    outputChatBox ( MensagemDormir, hitElement, 255, 255, 255, true )
end
addEventHandler( "onMarkerHit", MarkersDormir, EntrarNoMarkerMsgDormir )

function EntrarNoMarkerMsgDormir ( hitElement, matchingDimension )
    if isPedInVehicle ( hitElement ) then return end
    outputChatBox ( MensagemDormir, hitElement, 255, 255, 255, true )
end
addEventHandler( "onMarkerHit", MarkersDormir2, EntrarNoMarkerMsgDormir )

function EntrarNoMarkerMsgDormir ( hitElement, matchingDimension )
    if isPedInVehicle ( hitElement ) then return end
    outputChatBox ( MensagemDormir, hitElement, 255, 255, 255, true )
end
addEventHandler( "onMarkerHit", MarkersDormir3, EntrarNoMarkerMsgDormir )

function EntrarNoMarkerMsgDormir ( hitElement, matchingDimension )
    if isPedInVehicle ( hitElement ) then return end
    outputChatBox ( MensagemDormir, hitElement, 255, 255, 255, true )
end
addEventHandler( "onMarkerHit", MarkersDormir4, EntrarNoMarkerMsgDormir )

function EntrarNoMarkerMsgDormir ( hitElement, matchingDimension )
    if isPedInVehicle ( hitElement ) then return end
    outputChatBox ( MensagemDormir, hitElement, 255, 255, 255, true )
end
addEventHandler( "onMarkerHit", MarkersDormir5, EntrarNoMarkerMsgDormir )

function EntrarNoMarkerMsgDormir ( hitElement, matchingDimension )
    if isPedInVehicle ( hitElement ) then return end
    outputChatBox ( MensagemDormir, hitElement, 255, 255, 255, true )
end
addEventHandler( "onMarkerHit", MarkersDormir6, EntrarNoMarkerMsgDormir )

function EntrarNoMarkerMsgDormir ( hitElement, matchingDimension )
    if isPedInVehicle ( hitElement ) then return end
    outputChatBox ( MensagemDormir, hitElement, 255, 255, 255, true )
end
addEventHandler( "onMarkerHit", MarkersDormir7, EntrarNoMarkerMsgDormir )

function EntrarNoMarkerMsgDormir ( hitElement, matchingDimension )
    if isPedInVehicle ( hitElement ) then return end
    outputChatBox ( MensagemDormir, hitElement, 255, 255, 255, true )
end
addEventHandler( "onMarkerHit", MarkersDormir8, EntrarNoMarkerMsgDormir )

----------------------------------------------------------------------------------------------------------------------------------------

addEventHandler ("onPlayerLogin",root,function(_,Acc)
local SonoAcc2 = getAccountData ( Acc, "AirNew:Sono" )
  if SonoAcc2 == false then
   setElementData (source, "AirNew:Sono", 100)
   setElementData (source, "Sono:Logado", true)
   else
   setElementData (source, "AirNew:Sono", SonoAcc2 )
   setElementData (source, "Sono:Logado", true)
end
end)

----------------------------------------------------------------------------------------------------------------------------------------

function saveAccountDataSono ( account )
if isGuestAccount ( account ) then return false end
Player = getAccountPlayer (account)
Sonos = getElementData (Player, "AirNew:Sono" )
setAccountData (account,"AirNew:Sono",Sonos)
end

----------------------------------------------------------------------------------------------------------------------------------------

addEventHandler ( 'onPlayerQuit', root, function ( )
    local acc = getPlayerAccount ( source )
    saveAccountDataSono ( acc )
end )

----------------------------------------------------------------------------------------------------------------------------------------

addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), function( )        
 for _, plr in pairs( getElementsByType( "player" ) ) do 
 local Acc = getPlayerAccount (plr)
    if not isGuestAccount (Acc) then
    local SonoAcc = getAccountData (Acc,"AirNew:Sono")
        if SonoAcc == false then
        setElementData (plr,"AirNew:Sono",100)
        setElementData (plr, "Sono:Logado", true)
        else
        setElementData (plr,"AirNew:Sono",SonoAcc)
        setElementData (plr, "Sono:Logado", true)
        end
    end    
 end
 end)
 
----------------------------------------------------------------------------------------------------------------------------------------
 
addEventHandler ("onResourceStop",getResourceRootElement( getThisResource()),function()
for index,players in ipairs(getElementsByType("player")) do 
 local acc = getPlayerAccount ( players )
 saveAccountDataSono ( acc )
end
end)

 

-- arquivo teleport

 

--[[

 ################################################
 #                                              #
 #              Script Criado Por               #
 #           FACEBOOK.COM/AIRNEWSCR             #
 #           Down Liberado > NeverZ <         #
 #                                              #
 ################################################

--]]

--------------------------------------------------------------------------------------------

MarkerHotelDentro = createMarker ( 2214.89966, -1150.45386, 1025.79688 -1, "cylinder", 1.2, 255, 0, 0, 95 )--
setElementInterior ( MarkerHotelDentro, 15 )
setElementDimension ( MarkerHotelDentro, 0 )

--------------------------------------------------------------------------------------------

MarkerHotelLS = createMarker ( 2232.52173, -1159.84265, 25.89063 -1, "cylinder", 1.2, 255, 0, 0, 95 )--
BlipMarkerHotelLS = createBlipAttachedTo ( MarkerHotelLS, 47 )
setBlipVisibleDistance( BlipMarkerHotelLS, 150)

--------------------------------------------------------------------------------------------

MarkerHotelLV = createMarker ( 2628.35571, 2348.88379, 10.82031 -1, "cylinder", 1.2, 255, 0, 0, 95 )--
BlipMarkerHotelLV = createBlipAttachedTo ( MarkerHotelLV, 47 )
setBlipVisibleDistance( BlipMarkerHotelLV, 150)

--------------------------------------------------------------------------------------------

MarkerHotelSF = createMarker ( 1111.0579833984, -975.55035400391, 42.765625 -1, "cylinder", 1.2, 255, 0, 0, 95 )--
BlipMarkerHotelSF = createBlipAttachedTo ( MarkerHotelSF, 47 )
setBlipVisibleDistance( BlipMarkerHotelSF, 150)

--------------------------------------------------------------------------------------------

function TeleporteHotelLS ( source, matchingDimension )

if getElementType ( source ) == "vehicle" then return end
if isPedInVehicle ( source ) then return end

setTimer ( setElementInterior, 400, 1, source, 15 )
setTimer ( setElementDimension, 400, 1, source, 0 )
setTimer ( setElementPosition, 400, 1, source, 2216.38965, -1150.48132, 1025.79688 )
setTimer ( setElementRotation, 400, 1, source, 0, 0, 270 )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "Hotel>LS>Entrou", true )
setElementData (source, "Hotel>LV>Entrou", false )
setElementData (source, "Hotel>SF>Entrou", false )

end
addEventHandler ( "onMarkerHit", MarkerHotelLS, TeleporteHotelLS )

--------------------------------------------------------------------------------------------

function TeleporteHotelLV ( source, matchingDimension )

if getElementType ( source ) == "vehicle" then return end
if isPedInVehicle ( source ) then return end

setTimer ( setElementInterior, 400, 1, source, 15 )
setTimer ( setElementDimension, 400, 1, source, 0 )
setTimer ( setElementPosition, 400, 1, source, 2216.38965, -1150.48132, 1025.79688 )
setTimer ( setElementRotation, 400, 1, source, 0, 0, 270 )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "Hotel>LS>Entrou", false )
setElementData (source, "Hotel>LV>Entrou", true )
setElementData (source, "Hotel>SF>Entrou", false )

end
addEventHandler ( "onMarkerHit", MarkerHotelLV, TeleporteHotelLV )

--------------------------------------------------------------------------------------------

function TeleporteHotelSF ( source, matchingDimension )

if getElementType ( source ) == "vehicle" then return end
if isPedInVehicle ( source ) then return end

setTimer ( setElementInterior, 400, 1, source, 15 )
setTimer ( setElementDimension, 400, 1, source, 0 )
setTimer ( setElementPosition, 400, 1, source, 2216.38965, -1150.48132, 1025.79688 )
setTimer ( setElementRotation, 400, 1, source, 0, 0, 270 )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "Hotel>LS>Entrou", false )
setElementData (source, "Hotel>LV>Entrou", false )
setElementData (source, "Hotel>SF>Entrou", true )

end
addEventHandler ( "onMarkerHit", MarkerHotelSF, TeleporteHotelSF )

--------------------------------------------------------------------------------------------

function SairDaHotel ( source, matchingDimension )

if getElementType ( source ) == "vehicle" then return end
if isPedInVehicle ( source ) then return end

if getElementData (source, "Hotel>LS>Entrou", true ) then

setTimer ( setElementInterior, 400, 1, source, 0 )
setTimer ( setElementDimension, 400, 1, source, 0 )
setTimer ( setElementPosition, 400, 1, source, 2231.23315, -1159.86755, 25.83011 )
setTimer ( setElementRotation, 400, 1, source, 0, 0, 90 )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "Hotel>LS>Entrou", false )
setElementData (source, "Hotel>LV>Entrou", false )
setElementData (source, "Hotel>SF>Entrou", false )

else

if getElementData (source, "Hotel>LV>Entrou", true ) then

setTimer ( setElementInterior, 400, 1, source, 0 )
setTimer ( setElementDimension, 400, 1, source, 0 )
setTimer ( setElementPosition, 400, 1, source, 2629.15698, 2347.20386, 10.67188 )
setTimer ( setElementRotation, 400, 1, source, 0, 0, 210 )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "Hotel>LS>Entrou", false )
setElementData (source, "Hotel>LV>Entrou", false )
setElementData (source, "Hotel>SF>Entrou", false )

else

if getElementData (source, "Hotel>SF>Entrou", true ) then

setTimer ( setElementInterior, 400, 1, source, 0 )
setTimer ( setElementDimension, 400, 1, source, 0 )
setTimer ( setElementPosition, 400, 1, source, 1110.7645263672, -971.82977294922, 42.765625 )
setTimer ( setElementRotation, 400, 1, source, 0, 0, 90 )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "Hotel>LS>Entrou", false )
setElementData (source, "Hotel>LV>Entrou", false )
setElementData (source, "Hotel>SF>Entrou", false )

end
end
end
end
addEventHandler ( "onMarkerHit", MarkerHotelDentro, SairDaHotel )

--------------------------------------------------------------------------------------------

function SalvarLocalHotel(conta)
    if conta then
            local source = getAccountPlayer(conta)
            local emp = getElementData(source,"Hotel>LS>Entrou") or false
            setAccountData (conta, "Hotel>LS>Entrou",emp)
    end    
end

function CarregarLocalHotel(conta)
    if not (isGuestAccount (conta)) then
        if (conta) then    
            local source = getAccountPlayer(conta)    
            local emp = getAccountData(conta,"Hotel>LS>Entrou") or false
            setElementData (source, "Hotel>LS>Entrou", emp)
        end
    end    
end

function SalvarLocalHotel2(conta)
    if conta then
            local source = getAccountPlayer(conta)
            local emp = getElementData(source,"Hotel>LV>Entrou") or false
            setAccountData (conta, "Hotel>LV>Entrou",emp)
    end    
end

function CarregarLocalHotel2(conta)
    if not (isGuestAccount (conta)) then
        if (conta) then    
            local source = getAccountPlayer(conta)    
            local emp = getAccountData(conta,"Hotel>LV>Entrou") or false
            setElementData (source, "Hotel>LV>Entrou", emp)
        end
    end    
end

function SalvarLocalHotel3(conta)
    if conta then
            local source = getAccountPlayer(conta)
            local emp = getElementData(source,"Hotel>SF>Entrou") or false
            setAccountData (conta, "Hotel>SF>Entrou",emp)
    end    
end

function CarregarLocalHotel3(conta)
    if not (isGuestAccount (conta)) then
        if (conta) then    
            local source = getAccountPlayer(conta)    
            local emp = getAccountData(conta,"Hotel>SF>Entrou") or false
            setElementData (source, "Hotel>SF>Entrou", emp)
        end
    end    
end

--------------------------------------------------------------------------------------------

addEventHandler("onPlayerLogin", root,
  function( _, acc )
    setTimer(CarregarLocalHotel,50,1,acc)
    setTimer(CarregarLocalHotel2,50,1,acc)
    setTimer(CarregarLocalHotel3,50,1,acc)
  end
)

function IniciarScriptTeleHotel ( res )
    if res == getThisResource() then
        for i, player in ipairs(getElementsByType("player")) do
            local acc = getPlayerAccount(player)
            if not isGuestAccount(acc) then
                CarregarLocalHotel(acc)        
                CarregarLocalHotel2(acc)
                CarregarLocalHotel3(acc)
            end
        end
    end
end
addEventHandler ( "onResourceStart", getRootElement(), IniciarScriptTeleHotel )

function DesligarScriptTeleHotel ( res )
    if res == getThisResource() then
        for i, player in ipairs(getElementsByType("player")) do
            local acc = getPlayerAccount(player)
            if not isGuestAccount(acc) then
                SalvarLocalHotel(acc)    
                SalvarLocalHotel2(acc)
                SalvarLocalHotel3(acc)
            end
        end
    end
end 
addEventHandler ( "onResourceStop", getRootElement(), DesligarScriptTeleHotel )

function SairScriptTeleHotel ( quitType )
    local acc = getPlayerAccount(source)
    if not (isGuestAccount (acc)) then
        if acc then
            SalvarLocalHotel(acc)
            SalvarLocalHotel2(acc)
            SalvarLocalHotel3(acc)
        end
    end
end
addEventHandler ( "onPlayerQuit", getRootElement(), SairScriptTeleHotel )

--------------------------------------------------------------------------------------------

-- termina aqui

 

-- aquivo teleporte de loja

 

 

--[[

 ################################################
 #                                              #
 #              Script Criado Por               #
 #           FACEBOOK.COM/AIRNEWSCR             #
 #           Down Liberado > NeverZ <         #
 #                                              #
 ################################################

--]]

--------------------------------------------------------------------------------------------

MarkerFomeSedeDentro = createMarker ( 364.84924, -11.09794, 1001.85156 -1, "cylinder", 1.2, 255, 0, 0, 95 ) --
setElementInterior ( MarkerFomeSedeDentro, 9 )
setElementDimension ( MarkerFomeSedeDentro, 0 )

--------------------------------------------------------------------------------------------

MarkerFomeSedeLS = createMarker ( 2104.97046, -1806.49316, 13.55469 -1, "cylinder", 1.2, 255, 0, 0, 95 ) --
BlipMarkerFomeSedeLS = createBlipAttachedTo ( MarkerFomeSedeLS, 10 )
setBlipVisibleDistance( BlipMarkerFomeSedeLS, 150)

--------------------------------------------------------------------------------------------

MarkerFomeSedeLV = createMarker ( 2472.41040, 2034.10938, 11.06250 -1, "cylinder", 1.2, 255, 0, 0, 95 ) --
BlipMarkerFomeSedeLV = createBlipAttachedTo ( MarkerFomeSedeLV, 10 )
setBlipVisibleDistance( BlipMarkerFomeSedeLV, 150)

--------------------------------------------------------------------------------------------

MarkerFomeSedeSF = createMarker ( 1158.0522460938,-1473.7667236328,15.796875 -1, "cylinder", 1.2, 255, 0, 0, 95 ) --
BlipMarkerFomeSedeSF = createBlipAttachedTo ( MarkerFomeSedeSF, 10 )
setBlipVisibleDistance( BlipMarkerFomeSedeSF, 150)

--------------------------------------------------------------------------------------------

xEntrada, YEntrada, zEntrada = 364.93112, -9.87462, 1001.85156
RotEntrada = 0
InteriorEntrada = 9
DimensaoEntrada = 0

--------------------------------------------------------------------------------------------

function TeleporteFomeSedeLS ( source, matchingDimension )

if getElementType ( source ) == "vehicle" then return end
if isPedInVehicle ( source ) then return end

setTimer ( setElementInterior, 400, 1, source, InteriorEntrada )
setTimer ( setElementDimension, 400, 1, source, DimensaoEntrada )
setTimer ( setElementPosition, 400, 1, source, xEntrada, YEntrada, zEntrada )
setTimer ( setElementRotation, 400, 1, source, 0, 0, RotEntrada )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "FomeSede>LS>Entrou", true )
setElementData (source, "FomeSede>LV>Entrou", false )
setElementData (source, "FomeSede>SF>Entrou", false )

end
addEventHandler ( "onMarkerHit", MarkerFomeSedeLS, TeleporteFomeSedeLS )

--------------------------------------------------------------------------------------------

function TeleporteFomeSedeLV ( source, matchingDimension )

if getElementType ( source ) == "vehicle" then return end
if isPedInVehicle ( source ) then return end

setTimer ( setElementInterior, 400, 1, source, InteriorEntrada )
setTimer ( setElementDimension, 400, 1, source, DimensaoEntrada )
setTimer ( setElementPosition, 400, 1, source, xEntrada, YEntrada, zEntrada )
setTimer ( setElementRotation, 400, 1, source, 0, 0, RotEntrada )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "FomeSede>LS>Entrou", false )
setElementData (source, "FomeSede>LV>Entrou", true )
setElementData (source, "FomeSede>SF>Entrou", false )

end
addEventHandler ( "onMarkerHit", MarkerFomeSedeLV, TeleporteFomeSedeLV )

--------------------------------------------------------------------------------------------

function TeleporteFomeSedeSF ( source, matchingDimension )

if getElementType ( source ) == "vehicle" then return end
if isPedInVehicle ( source ) then return end

setTimer ( setElementInterior, 400, 1, source, InteriorEntrada )
setTimer ( setElementDimension, 400, 1, source, DimensaoEntrada )
setTimer ( setElementPosition, 400, 1, source, xEntrada, YEntrada, zEntrada )
setTimer ( setElementRotation, 400, 1, source, 0, 0, RotEntrada )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "FomeSede>LS>Entrou", false )
setElementData (source, "FomeSede>LV>Entrou", false )
setElementData (source, "FomeSede>SF>Entrou", true )

end
addEventHandler ( "onMarkerHit", MarkerFomeSedeSF, TeleporteFomeSedeSF )

--------------------------------------------------------------------------------------------

function SairDaFomeSede ( source, matchingDimension )

if getElementType ( source ) == "vehicle" then return end
if isPedInVehicle ( source ) then return end

if getElementData (source, "FomeSede>LS>Entrou", true ) then

setTimer ( setElementInterior, 400, 1, source, 0 )
setTimer ( setElementDimension, 400, 1, source, 0 )
setTimer ( setElementPosition, 400, 1, source, 2103.20166, -1806.42432, 13.55469 ) --
setTimer ( setElementRotation, 400, 1, source, 0, 0, 90 )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "FomeSede>LS>Entrou", false )
setElementData (source, "FomeSede>LV>Entrou", false )
setElementData (source, "FomeSede>SF>Entrou", false )

else

if getElementData (source, "FomeSede>LV>Entrou", true ) then

setTimer ( setElementInterior, 400, 1, source, 0 )
setTimer ( setElementDimension, 400, 1, source, 0 )
setTimer ( setElementPosition, 400, 1, source, 2470.82642, 2034.21338, 11.06250 ) --
setTimer ( setElementRotation, 400, 1, source, 0, 0, 90 )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "FomeSede>LS>Entrou", false )
setElementData (source, "FomeSede>LV>Entrou", false )
setElementData (source, "FomeSede>SF>Entrou", false )

else

if getElementData (source, "FomeSede>SF>Entrou", true ) then

setTimer ( setElementInterior, 400, 1, source, 0 )
setTimer ( setElementDimension, 400, 1, source, 0 )
setTimer ( setElementPosition, 400, 1, source, 1154.4041748047,-1475.4573974609,15.800312042236 ) --
setTimer ( setElementRotation, 400, 1, source, 0, 0, 0 )
fadeCamera ( source, false, 0.1, 0, 0, 0 )   
setTimer ( fadeCamera, 600, 1, source , true, 0.5 )
setTimer ( setCameraTarget, 600, 1, source )

setElementData (source, "FomeSede>LS>Entrou", false )
setElementData (source, "FomeSede>LV>Entrou", false )
setElementData (source, "FomeSede>SF>Entrou", false )

end
end
end
end
addEventHandler ( "onMarkerHit", MarkerFomeSedeDentro, SairDaFomeSede )

--------------------------------------------------------------------------------------------

function SalvarLocalFomeSede(conta)
    if conta then
            local source = getAccountPlayer(conta)
            local emp = getElementData(source,"FomeSede>LS>Entrou") or false
            setAccountData (conta, "FomeSede>LS>Entrou",emp)
    end    
end

function CarregarLocalFomeSede(conta)
    if not (isGuestAccount (conta)) then
        if (conta) then    
            local source = getAccountPlayer(conta)    
            local emp = getAccountData(conta,"FomeSede>LS>Entrou") or false
            setElementData (source, "FomeSede>LS>Entrou", emp)
        end
    end    
end

function SalvarLocalFomeSede2(conta)
    if conta then
            local source = getAccountPlayer(conta)
            local emp = getElementData(source,"FomeSede>LV>Entrou") or false
            setAccountData (conta, "FomeSede>LV>Entrou",emp)
    end    
end

function CarregarLocalFomeSede2(conta)
    if not (isGuestAccount (conta)) then
        if (conta) then    
            local source = getAccountPlayer(conta)    
            local emp = getAccountData(conta,"FomeSede>LV>Entrou") or false
            setElementData (source, "FomeSede>LV>Entrou", emp)
        end
    end    
end

function SalvarLocalFomeSede3(conta)
    if conta then
            local source = getAccountPlayer(conta)
            local emp = getElementData(source,"FomeSede>SF>Entrou") or false
            setAccountData (conta, "FomeSede>SF>Entrou",emp)
    end    
end

function CarregarLocalFomeSede3(conta)
    if not (isGuestAccount (conta)) then
        if (conta) then    
            local source = getAccountPlayer(conta)    
            local emp = getAccountData(conta,"FomeSede>SF>Entrou") or false
            setElementData (source, "FomeSede>SF>Entrou", emp)
        end
    end    
end

--------------------------------------------------------------------------------------------

addEventHandler("onPlayerLogin", root,
  function( _, acc )
    setTimer(CarregarLocalFomeSede,50,1,acc)
    setTimer(CarregarLocalFomeSede2,50,1,acc)
    setTimer(CarregarLocalFomeSede3,50,1,acc)
  end
)

function IniciarScriptTeleFomeSede ( res )
    if res == getThisResource() then
        for i, player in ipairs(getElementsByType("player")) do
            local acc = getPlayerAccount(player)
            if not isGuestAccount(acc) then
                CarregarLocalFomeSede(acc)        
                CarregarLocalFomeSede2(acc)
                CarregarLocalFomeSede3(acc)
            end
        end
    end
end
addEventHandler ( "onResourceStart", getRootElement(), IniciarScriptTeleFomeSede )

function DesligarScriptTeleFomeSede ( res )
    if res == getThisResource() then
        for i, player in ipairs(getElementsByType("player")) do
            local acc = getPlayerAccount(player)
            if not isGuestAccount(acc) then
                SalvarLocalFomeSede(acc)    
                SalvarLocalFomeSede2(acc)
                SalvarLocalFomeSede3(acc)
            end
        end
    end
end 
addEventHandler ( "onResourceStop", getRootElement(), DesligarScriptTeleFomeSede )

function SairScriptTeleFomeSede ( quitType )
    local acc = getPlayerAccount(source)
    if not (isGuestAccount (acc)) then
        if acc then
            SalvarLocalFomeSede(acc)
            SalvarLocalFomeSede2(acc)
            SalvarLocalFomeSede3(acc)
        end
    end
end
addEventHandler ( "onPlayerQuit", getRootElement(), SairScriptTeleFomeSede )

--------------------------------------------------------------------------------------------

-- termina aqui se alguem souber onde eu errei quando eu montei na minha hud me ajuda por favor 

 

Share this post


Link to post

Olá novamente @vanessa, acabei deixando passar no outro post porém para ficar mais fácil de estarmos te ajudando, por favor poste o seu código corretamente clicando sobre o botão code <>  

Abaixo uma imagem ilustrativa do botão:

ux5Wjw7.jpg

lib3RV2.jpg

Se você puder estar editando o seu tópico e fazendo desta maneira, ficara mais fácil para os membros lhe ajudar! 

 

Bom quanto ao seu problema você chegou a verificar seu /debugscript 3? Para ver se aparece algum erro quanto aos Resources?

Qual o problema exato com a sua hud?

Ela não liga?

Ela liga, porém falta alguma coisa nela ou algo do tipo?

Edited by Developer.

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.