#1WallSex Set 12, 2014 12:06 pm
Wall
Moderador
Depois de Veicle Adicione
setElementData(spalteGuiText[number],"usedItem","tent")
number = number+1
guiSetVisible(spalteGuiImage[number],true)
guiSetText(spalteGuiText[number],"Dormir")
setElementData(spalteGuiText[number],"usedItem","tent-sleep")
return
Ainda adicione em baixo de check temperature adc
local xsl,ysl = guiGetScreenSize ()
function renderSleepDisplay ()
dxDrawImage ( 0, 0, xsl,ysl, "images/sleep.png" )
local sleep = getElementData ( localPlayer, "sleep" )
if sleep >= 20 and sleep <= 40 then
dxDrawRectangle ( 50, ysl-50, 60, 15, tocolor ( 95,161,64) ) -- 95, 50, 15
elseif sleep > 40 and sleep <= 70 then
dxDrawRectangle ( 50, ysl-70, 60, 35, tocolor ( 95,161,64) ) -- 95, 50, 15
elseif sleep > 70 then
dxDrawRectangle ( 50, ysl-95, 60, 60, tocolor ( 95,161,64) ) -- 95, 50, 15
end
dxDrawImage ( 20, ysl-128, 128,128, "images/sleepclock.png" )
end
function makePlayerSleep ()
addEventHandler ( "onClientRender", root, renderSleepDisplay )
--sleepTimer = setTimer ( finishSleep, 20000, 1 )
sleepTimer = setTimer ( finishSleep, 120000, 1 )
--sleepRepTimer = setTimer ( givePlayerSleepPoints, 2000, 6 )
sleepRepTimer = setTimer ( givePlayerSleepPoints, 20000, 6 )
setElementFrozen ( localPlayer, true )
end
function givePlayerSleepPoints ()
if getElementData ( localPlayer, "sleeping" ) then
setElementData ( localPlayer, "sleep", getElementData ( localPlayer, "sleep" ) + 15 )
if getElementData ( localPlayer, "sleep" ) > 100 then
finishSleep()
if isTimer ( sleepTimer ) then
killTimer ( sleepTimer )
end
if isTimer ( sleepRepTimer ) then
killTimer ( sleepRepTimer )
end
end
else
if isTimer ( sleepTimer ) then
killTimer ( sleepTimer )
end
end
end
function wastedMessage ( killer, weapon, bodypart )
if getElementData ( source, "sleeping" ) then
finishSleep()
if isTimer ( sleepTimer ) then
killTimer ( sleepTimer )
end
if isTimer ( sleepRepTimer ) then
killTimer ( sleepRepTimer )
end
end
end
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wastedMessage )
function finishSleep ()
if getElementData ( localPlayer, "sleeping" ) then
removeEventHandler ( "onClientRender", root, renderSleepDisplay )
setElementData ( localPlayer, "sleep", 100 )
setElementData ( localPlayer, "sleeping", false )
setElementFrozen ( localPlayer, false )
triggerServerEvent("makePlayerUnSleep",getLocalPlayer())
end
end
Depois adicione embaixo de tent
if itemName == "tent-sleep" then
if not getElementData ( localPlayer, "sleeping" ) then
setElementData ( localPlayer, "sleeping", true )
makePlayerSleep ()
triggerServerEvent("makePlayerSleep",getLocalPlayer())
end
disableMenu()
return
end
em spwn.lua
embaixo dse food
{"sleep"},
Na login.lua adc embaixo de cold
{"sleep"},
Sistema para aparecer
--sleep
local sleep = getElementData(getLocalPlayer(),"sleep")*2.55
r,g,b = 255-sleep,sleep,0
dxDrawImage ( screenWidth*0.94 , screenHeight*0.7, screenHeight*0.065, screenHeight*0.065, "images/sleep1.png",0,0,0,tocolor(r,g,b))
Na survivorsystem.client ainda adc
lá em cima de chcktemperature
function checkSleeping()
if getElementData(getLocalPlayer(),"logedin") then
if ( getElementData(getLocalPlayer(),"sleep") or 0 ) <= 20 then
toggleControl ( "sprint", false )
elseif not getElementData ( localPlayer, "brokenbone" ) then
toggleControl ( "sprint", true )
end
end
end
setTimer(checkSleeping,1400,0)
function reduceSleep ()
if getElementData(getLocalPlayer(),"logedin") then
if not getElementData ( localPlayer, "sleep" ) then
setElementData ( localPlayer, "sleep", 100 )
end
if getElementData ( localPlayer, "sleep" ) > 0 then
setElementData ( localPlayer, "sleep", ( getElementData ( localPlayer, 'sleep' ) or 0 ) - 1 )
end
end
end
setTimer(reduceSleep,80000,0)
No final da Survivorsystem.lua ADC:
function makePlayerSleepS( )
setPedAnimation ( source, "BEACH", "Lay_Bac_Loop", -1, true, false, false )
end
addEvent("makePlayerSleep", true)
addEventHandler("makePlayerSleep", getRootElement(), makePlayerSleepS)
function makeUnPlayerSleepS( )
stPedAnimation ( source, false )
end
addEvent("makePlayerUnSleep", true)
addEventHandler("makePlayerUnSleep", getRootElement(), makeUnPlayerSleepS)
Adicione no meta:
Download Das Imagens:
creditos nathan.minecraft5
setElementData(spalteGuiText[number],"usedItem","tent")
number = number+1
guiSetVisible(spalteGuiImage[number],true)
guiSetText(spalteGuiText[number],"Dormir")
setElementData(spalteGuiText[number],"usedItem","tent-sleep")
return
Ainda adicione em baixo de check temperature adc
local xsl,ysl = guiGetScreenSize ()
function renderSleepDisplay ()
dxDrawImage ( 0, 0, xsl,ysl, "images/sleep.png" )
local sleep = getElementData ( localPlayer, "sleep" )
if sleep >= 20 and sleep <= 40 then
dxDrawRectangle ( 50, ysl-50, 60, 15, tocolor ( 95,161,64) ) -- 95, 50, 15
elseif sleep > 40 and sleep <= 70 then
dxDrawRectangle ( 50, ysl-70, 60, 35, tocolor ( 95,161,64) ) -- 95, 50, 15
elseif sleep > 70 then
dxDrawRectangle ( 50, ysl-95, 60, 60, tocolor ( 95,161,64) ) -- 95, 50, 15
end
dxDrawImage ( 20, ysl-128, 128,128, "images/sleepclock.png" )
end
function makePlayerSleep ()
addEventHandler ( "onClientRender", root, renderSleepDisplay )
--sleepTimer = setTimer ( finishSleep, 20000, 1 )
sleepTimer = setTimer ( finishSleep, 120000, 1 )
--sleepRepTimer = setTimer ( givePlayerSleepPoints, 2000, 6 )
sleepRepTimer = setTimer ( givePlayerSleepPoints, 20000, 6 )
setElementFrozen ( localPlayer, true )
end
function givePlayerSleepPoints ()
if getElementData ( localPlayer, "sleeping" ) then
setElementData ( localPlayer, "sleep", getElementData ( localPlayer, "sleep" ) + 15 )
if getElementData ( localPlayer, "sleep" ) > 100 then
finishSleep()
if isTimer ( sleepTimer ) then
killTimer ( sleepTimer )
end
if isTimer ( sleepRepTimer ) then
killTimer ( sleepRepTimer )
end
end
else
if isTimer ( sleepTimer ) then
killTimer ( sleepTimer )
end
end
end
function wastedMessage ( killer, weapon, bodypart )
if getElementData ( source, "sleeping" ) then
finishSleep()
if isTimer ( sleepTimer ) then
killTimer ( sleepTimer )
end
if isTimer ( sleepRepTimer ) then
killTimer ( sleepRepTimer )
end
end
end
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wastedMessage )
function finishSleep ()
if getElementData ( localPlayer, "sleeping" ) then
removeEventHandler ( "onClientRender", root, renderSleepDisplay )
setElementData ( localPlayer, "sleep", 100 )
setElementData ( localPlayer, "sleeping", false )
setElementFrozen ( localPlayer, false )
triggerServerEvent("makePlayerUnSleep",getLocalPlayer())
end
end
Depois adicione embaixo de tent
if itemName == "tent-sleep" then
if not getElementData ( localPlayer, "sleeping" ) then
setElementData ( localPlayer, "sleeping", true )
makePlayerSleep ()
triggerServerEvent("makePlayerSleep",getLocalPlayer())
end
disableMenu()
return
end
em spwn.lua
embaixo dse food
{"sleep"},
Na login.lua adc embaixo de cold
{"sleep"},
Sistema para aparecer
--sleep
local sleep = getElementData(getLocalPlayer(),"sleep")*2.55
r,g,b = 255-sleep,sleep,0
dxDrawImage ( screenWidth*0.94 , screenHeight*0.7, screenHeight*0.065, screenHeight*0.065, "images/sleep1.png",0,0,0,tocolor(r,g,b))
Na survivorsystem.client ainda adc
lá em cima de chcktemperature
function checkSleeping()
if getElementData(getLocalPlayer(),"logedin") then
if ( getElementData(getLocalPlayer(),"sleep") or 0 ) <= 20 then
toggleControl ( "sprint", false )
elseif not getElementData ( localPlayer, "brokenbone" ) then
toggleControl ( "sprint", true )
end
end
end
setTimer(checkSleeping,1400,0)
function reduceSleep ()
if getElementData(getLocalPlayer(),"logedin") then
if not getElementData ( localPlayer, "sleep" ) then
setElementData ( localPlayer, "sleep", 100 )
end
if getElementData ( localPlayer, "sleep" ) > 0 then
setElementData ( localPlayer, "sleep", ( getElementData ( localPlayer, 'sleep' ) or 0 ) - 1 )
end
end
end
setTimer(reduceSleep,80000,0)
No final da Survivorsystem.lua ADC:
function makePlayerSleepS( )
setPedAnimation ( source, "BEACH", "Lay_Bac_Loop", -1, true, false, false )
end
addEvent("makePlayerSleep", true)
addEventHandler("makePlayerSleep", getRootElement(), makePlayerSleepS)
function makeUnPlayerSleepS( )
stPedAnimation ( source, false )
end
addEvent("makePlayerUnSleep", true)
addEventHandler("makePlayerUnSleep", getRootElement(), makeUnPlayerSleepS)
Adicione no meta:
Download Das Imagens:
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
creditos nathan.minecraft5