Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if GetConVarNumber( "hat_enable" )==1 then
- surface.CreateFont( "Whatever", {
- font = "Arial",
- extended = false,
- size = 13,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false,
- } )
- local cTimeT=CurTime() + 25
- local cTimeH=CurTime() + 40
- local cTimeR=CurTime() + 5
- local cur_hat_h = GetConVarNumber( "hat_max_hunger_amount" )
- local cur_hat_t = GetConVarNumber( "hat_max_thirst_amount" )
- local function setHATHP()
- net.Start("setHatHP")
- net.SendToServer()
- end
- net.Receive("hat_water_bk",function( len, pl )
- cur_hat_t = cur_hat_t + 12
- end)
- net.Receive("hat_takeout_bk",function( len, pl )
- cur_hat_h = cur_hat_h + 9
- end)
- net.Receive("hat_bread_bk",function( len, pl )
- cur_hat_h = cur_hat_h + 13
- end)
- net.Receive("hat_beer_bk",function( len, pl )
- cur_hat_t = cur_hat_t + 2
- end)
- net.Receive("hat_hotdog_bk",function( len, pl )
- cur_hat_h = cur_hat_h + 6
- end)
- net.Receive("hat_hamburger_bk",function( len, pl )
- cur_hat_h = cur_hat_h + 7
- end)
- net.Receive("hat_milk_bk",function( len, pl )
- cur_hat_t = cur_hat_t + 10
- end)
- net.Receive("hat_soda_bk",function( len, pl )
- cur_hat_t = cur_hat_t + 3
- end)
- net.Receive("hat_potato_bk",function( len, pl )
- cur_hat_h = cur_hat_h + 1
- end)
- local function setHatPDATA()
- net.Start("setHatPDATA")
- net.WriteInt( cur_hat_h, 30 )
- net.WriteInt( cur_hat_t, 30 )
- net.SendToServer()
- end
- hook.Add( "Think", "CurTimeHatT", function()
- if CurTime() < cTimeT then return end
- if GetConVarNumber( "hat_enable" )==1 then
- cur_hat_t = cur_hat_t - 2
- setHatPDATA()
- --if cur_hat_t<30 then ACTIVATOR:SetHealth(ACTIVATOR:Health()+50) end
- if cur_hat_t<100 then Entity(1):TakeDamage( 5 ) end
- if cur_hat_t<99 then chat.AddText( Color(255,0,0), "Your too thirsty, your loosing health... ") end
- if cur_hat_t<0 then cur_hat_t=0 end
- end
- cTimeT=CurTime() + 100
- end)
- hook.Add( "Think", "CurTimeHatH", function()
- if CurTime() < cTimeH then return end
- if GetConVarNumber( "hat_enable" )==1 then
- cur_hat_h = cur_hat_h - 2
- setHatPDATA()
- if cur_hat_h<40 then RunConsoleCommand( "hurtme","5" ) end
- if cur_hat_h<40 then RunConsoleCommand( "say","is too hungry, is loosing health..." ) end
- if cur_hat_h<0 then cur_hat_h=0 end
- end
- cTimeH=CurTime() + 160
- end)
- hook.Add( "Think", "CurTimeHatHT", function()
- if CurTime() < cTimeR then return end
- if GetConVarNumber( "hat_enable" )==1 then
- if cur_hat_t>GetConVarNumber( "hat_max_thirst_amount" ) then cur_hat_t=GetConVarNumber( "hat_max_thirst_amount" ) end
- if cur_hat_h>GetConVarNumber( "hat_max_hunger_amount" ) then cur_hat_h=GetConVarNumber( "hat_max_hunger_amount" ) end
- end
- cTimeR=CurTime() + 5
- end)
- net.Receive("setHatPDATAReco",function( len )
- cur_hat_hr = net.ReadInt( 30 )
- cur_hat_tr = net.ReadInt( 30 )
- if cur_hat_hr != cur_hat_h then setHatPDATA() end
- if cur_hat_tr != cur_hat_t then setHatPDATA() end
- end)
- net.Receive("setHatReset",function()
- cur_hat_h = GetConVarNumber( "hat_max_hunger_amount" )
- cur_hat_t = GetConVarNumber( "hat_max_thirst_amount" )
- setHatPDATA()
- end)
- hook.Add("HUDPaint", "DrawMyHud", function()
- draw.SimpleText("Hunger:"..cur_hat_h,"Whatever",250,10 + 15,Color(255,255,0),1,1)
- draw.SimpleText("Thirst:"..cur_hat_t,"Whatever",10+150,10 + 15,Color(255,255,0),1,1)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement