• TTT Spriting / Stamina Bar
    32 replies, posted
first, excuse me for my english due it is not my native language. I'm LOOKING FOR ADDONS TTT Spriting / Stamina Bar anyone know any or know somo code of this ? something like this [IMG]http://i62.tinypic.com/2d91v7q.png[/IMG]
It was on code hire part of some add-on called enhanced / advanced TTT or something like that.
Does anyone know?
up pls
Found this on another face punch post, place it in gmodserver\garrysmod\lua\autorun. Im not sure if it works but go ahead and test it. Download: [URL="http://www.mediafire.com/download/71uqdr795mqpuz1/stamina.lua"]http://www.mediafire.com/download/71uqdr795mqpuz1/stamina.lua[/URL] [CODE]if CLIENT then if not FStaminaToggled then function FStamina_Draw() if LocalPlayer():GetNWInt( "FStamina" ) then if LocalPlayer():Alive() then local Fx = ( ScrH()/23.272727272727272727272727272727 ) local Fy = ( ScrH()/1.0385395537525354969574036511156 ) local Fx = ( ScrW()/6.7368421052631578947368421052632 ) local Fy = ( ScrH()/146.28571428571428571428571428571 ) draw.RoundedBox( 4, Fx, Fy, Fx, Fy, Color( 90, 90, 90, 255 ) ) if LocalPlayer():GetNWInt( "FStamina" ) > 1 then draw.RoundedBox( 4, Fx, Fy, Fx*( LocalPlayer():GetNWInt( "FStamina" )/100 ), Fy, Color( 255, 242, 0, 255 ) ) end end end end hook.Add( "HUDPaint", "FStamina_Draw", FStamina_Draw ) end end if SERVER then if not FStaminaToggled then function FStamina_Spawn( ply ) ply:SetNWInt( "FStamina", 100 ) end hook.Add( "PlayerSpawn", "FStamina_Spawn", FStamina_Spawn ) function FStamina_MainThink() for k, ply in pairs( player.GetAll() ) do if ply:GetNWInt( "FStamina" ) < 0 then ply:SetNWInt( "FStamina", 0 ) end if ply:GetNWInt( "FStamina" ) > 100 then ply:SetNWInt( "FStamina", 100 ) end if ply.LastHealth and ply.LastHealth > ply:Health() then local damage = ( ply.LastHealth - ply:Health() )*2 ply.LastHealth = ply:Health() ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" ) - damage ) elseif not ply.LastHealth then ply.LastHealth = ply:Health() end if ply:GetMoveType() ~= MOVETYPE_NOCLIP then if ( ply:KeyDown( IN_SPEED ) or ply:KeyPressed( IN_SPEED ) ) and ply:GetNWInt( "FStamina" ) > 0 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ply:GetRunSpeed()/12000 ) ) ) ply.LastFStamina = CurTime() + 3 if ply:KeyPressed( IN_JUMP ) and ply:GetNWInt( "FStamina" ) > 0 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-10 ) ply.LastFStamina = CurTime() + 3 end if ply:WaterLevel() == 3 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) ) end elseif ply:KeyPressed( IN_JUMP ) and ply:GetNWInt( "FStamina" ) > 0 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-10 ) ply.LastFStamina = CurTime() + 3 if ply:WaterLevel() == 3 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) ) end elseif ( ply:KeyDown( IN_FORWARD ) or ply:KeyDown( IN_BACK ) or ply:KeyDown( IN_MOVELEFT ) or ply:KeyDown( IN_MOVERIGHT ) ) and ply:GetNWInt( "MStamina" ) > 0 then if ply:GetMoveType() == MOVETYPE_LADDER or ply:WaterLevel() == 1 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.2 ) ) ) elseif ply:WaterLevel() == 3 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) ) end elseif ply.LastMStamina and ply.LastMStamina < CurTime() then if ply:IsOnGround() and ply:WaterLevel() == 0 then ply:SetNWInt( "FStamina", ply:GetNWInt( "MStamina" )+2 ) elseif ply:WaterLevel() == 1 then ply:SetNWInt( "FStamina", ply:GetNWInt( "MStamina" )+3 ) end ply:SetRunSpeed( ply.FRunSPeed ) ply:SetJumpPower( ply.FJumpPower ) ply.FRunSPeed = nil ply.FJumpPower = nil elseif ply:GetNWInt( "FStamina" ) <= 0 and ( ply:GetRunSpeed() > 0 or ply:GetJumpPower() > 0 ) then ply.FRunSpeed = ply:GetRunSpeed() ply.FJumpPower = ply:GetJumpPower() ply:SetWalkSpeed( 250 ) ply:SetRunSpeed( ply:GetWalkSpeed() ) ply:SetJumpPower( 0 ) end if ply:KeyDown( IN_SPEED ) and ply:GetNWInt( "FStamina" ) <= 0 then ply:SetRunSpeed( ply:GetWalkSpeed() ) end end end end hook.Add( "Think", "FStamina_MainThink", FStamina_MainThink ) end end function FStamina_Toggle() if FStaminaToggled then FStaminaToggled = false else FStaminaToggled = true end end concommand.Add( "FanStamina_toggle", FStamina_Toggle ) function FStamina_Regen() for k, v in pairs(player.GetAll()) do if (v:GetMoveType() ~= MOVETYPE_NOCLIP) and (!v:KeyDown(IN_SPEED)) and (!v:KeyDown(IN_JUMP)) and (!v:KeyDown(IN_FORWARD)) and (!v:KeyDown(IN_BACK)) and (!v:KeyDown(IN_MOVELEFT)) and (!v:KeyDown(IN_MOVERIGHT)) then local Stam = v:GetNWInt("FStamina") if v:IsOnGround() and v:WaterLevel() == 0 then v:SetNWInt( "FStamina", math.Clamp(Stam+2, 0, 100)) elseif v:WaterLevel() == 1 then v:SetNWInt( "FStamina", math.Clamp(Stam+3, 0, 100)) end end end end timer.Create("FStamina_Regen", 0.5, 0, FStamina_Regen)[/CODE]
I had already tried this, but it's not the same, it's just to jump. I want something to run
Advanced TTT has its own sprint and stamina bar. Look into that.
where i download it ?
It's for sale, or was?
It was on CoderHire but can't buy it anymore.
fk But what you can not find in another place?
[QUOTE=highlife20;46115028]fk But what you can not find in another place?[/QUOTE] The script Nick posted works, I tested it. Though, you should edit how much the energy drains, it's really slow.... Just kidding, did it for you (and removed jump reduce) [code] if CLIENT then if not FStaminaToggled then function FStamina_Draw() if LocalPlayer():GetNWInt( "FStamina" ) then if LocalPlayer():Alive() then local Fx = ( ScrH()/23.272727272727272727272727272727 ) local Fy = ( ScrH()/1.0385395537525354969574036511156 ) local Fx = ( ScrW()/6.7368421052631578947368421052632 ) local Fy = ( ScrH()/146.28571428571428571428571428571 ) draw.RoundedBox( 4, Fx, Fy, Fx, Fy, Color( 90, 90, 90, 255 ) ) if LocalPlayer():GetNWInt( "FStamina" ) > 1 then draw.RoundedBox( 4, Fx, Fy, Fx*( LocalPlayer():GetNWInt( "FStamina" )/100 ), Fy, Color( 255, 242, 0, 255 ) ) end end end end hook.Add( "HUDPaint", "FStamina_Draw", FStamina_Draw ) end end if SERVER then if not FStaminaToggled then function FStamina_Spawn( ply ) ply:SetNWInt( "FStamina", 100 ) end hook.Add( "PlayerSpawn", "FStamina_Spawn", FStamina_Spawn ) function FStamina_MainThink() for k, ply in pairs( player.GetAll() ) do if ply:GetNWInt( "FStamina" ) < 0 then ply:SetNWInt( "FStamina", 0 ) end if ply:GetNWInt( "FStamina" ) > 100 then ply:SetNWInt( "FStamina", 100 ) end if ply.LastHealth and ply.LastHealth > ply:Health() then local damage = ( ply.LastHealth - ply:Health() )*2 ply.LastHealth = ply:Health() ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" ) - damage ) elseif not ply.LastHealth then ply.LastHealth = ply:Health() end if ply:GetMoveType() ~= MOVETYPE_NOCLIP then if ( ply:KeyDown( IN_SPEED ) or ply:KeyPressed( IN_SPEED ) ) and ply:GetNWInt( "FStamina" ) > 0 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ply:GetRunSpeed()/1000 ) ) ) ply.LastFStamina = CurTime() + 3 if ply:WaterLevel() == 3 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) ) end elseif ( ply:KeyDown( IN_FORWARD ) or ply:KeyDown( IN_BACK ) or ply:KeyDown( IN_MOVELEFT ) or ply:KeyDown( IN_MOVERIGHT ) ) and ply:GetNWInt( "MStamina" ) > 0 then if ply:GetMoveType() == MOVETYPE_LADDER or ply:WaterLevel() == 1 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.2 ) ) ) elseif ply:WaterLevel() == 3 then ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) ) end elseif ply.LastMStamina and ply.LastMStamina < CurTime() then if ply:IsOnGround() and ply:WaterLevel() == 0 then ply:SetNWInt( "FStamina", ply:GetNWInt( "MStamina" )+2 ) elseif ply:WaterLevel() == 1 then ply:SetNWInt( "FStamina", ply:GetNWInt( "MStamina" )+3 ) end ply:SetRunSpeed( ply.FRunSPeed ) ply.FRunSPeed = nil elseif ply:GetNWInt( "FStamina" ) <= 0 and ( ply:GetRunSpeed() > 0) then ply.FRunSpeed = ply:GetRunSpeed() ply:SetWalkSpeed( 250 ) ply:SetRunSpeed( ply:GetWalkSpeed() ) end if ply:KeyDown( IN_SPEED ) and ply:GetNWInt( "FStamina" ) <= 0 then ply:SetRunSpeed( ply:GetWalkSpeed() ) end end end end hook.Add( "Think", "FStamina_MainThink", FStamina_MainThink ) end end function FStamina_Toggle() if FStaminaToggled then FStaminaToggled = false else FStaminaToggled = true end end concommand.Add( "FanStamina_toggle", FStamina_Toggle ) function FStamina_Regen() for k, v in pairs(player.GetAll()) do if (v:GetMoveType() ~= MOVETYPE_NOCLIP) and (!v:KeyDown(IN_SPEED)) and (!v:KeyDown(IN_FORWARD)) and (!v:KeyDown(IN_BACK)) and (!v:KeyDown(IN_MOVELEFT)) and (!v:KeyDown(IN_MOVERIGHT)) then local Stam = v:GetNWInt("FStamina") if v:IsOnGround() and v:WaterLevel() == 0 then v:SetNWInt( "FStamina", math.Clamp(Stam+2, 0, 100)) elseif v:WaterLevel() == 1 then v:SetNWInt( "FStamina", math.Clamp(Stam+3, 0, 100)) end end end end timer.Create("FStamina_Regen", 0.5, 0, FStamina_Regen) [/code]
And how I installed it?
Run it shared.
???
[QUOTE=highlife20;46119577]???[/QUOTE] Run it in some shared file, either lua/autorun or some gamemode file. Either way, make sure it runs after the gamemode is loaded.
And how do I do to use it?
It will automatically load to the server (after restart) look at the top of your screen.
And where should I put it?
Put that code in /lua/autorun/stamina.lua Make a file named stamina.lua
I made it simple for you guys [url]http://www.mediafire.com/download/v2soz585df150t9/Stamina+Addon.zip[/url]
That code is excessive and crap. I've half done ttt_movemod which at the moment features weapon weight. Will finish it off tomorrow. The progress can be found in the coderhire addon cloning thread. Edit... Bluebull... they way you've done that wont support linux. keep the folder names lower-case.
[QUOTE=bluebull107;46128636]I made it simple for you guys [url]http://www.mediafire.com/download/v2soz585df150t9/Stamina+Addon.zip[/url][/QUOTE] [code]if (v:GetMoveType() ~ord operator">= MOVETYPE_NOCLIP) and (!v:KeyDown(IN_SPEED)) and (!v:KeyDown(IN_FORWARD)) and (!v:KeyDown(IN_BACK)) and (!v:KeyDown(IN_MOVELEFT)) and (!v:KeyDown(IN_MOVERIGHT)) then[/code] [code] local Fx = ( ScrH()/23.272727272727272727272727272727 ) local Fy = ( ScrH()/1.0385395537525354969574036511156 ) local Fx = ( ScrW()/6.7368421052631578947368421052632 ) local Fy = ( ScrH()/146.28571428571428571428571428571 )[/code] What.
All I did was copy and paste Swik's code so show him exactly where to put it...I did not edit the code at all.
[QUOTE=bluebull107;46132176]All I did was copy and paste Swik's code so show him exactly where to put it...I did not edit the code at all.[/QUOTE] ^^ Still doesn't work on linux... Also why bother, its the coders fault if he doesn't put it layman's terms. You've just made yourself look silly again. So once again I say. Stop Posting!
[QUOTE=Steeze;46134146]^^ Still doesn't work on linux... Also why bother, its the coders fault if he doesn't put it layman's terms. You've just made yourself look silly again. So once again I say. Stop Posting![/QUOTE] Steeze, at least he's trying to do something productive, and those positions weren't mine, look at the original code posted, take your own advice and "Stop Posting!" because, no one like a meanie head. [editline]2nd October 2014[/editline] All I did was remove the jump stamina, though I did a few edits after that I haven't posted, I'll fix the posisitons, and other weird shit, does anyone know who created this?
This is where I found it: [URL="http://facepunch.com/showthread.php?t=1124545"]http://facepunch.com/showthread.php?t=1124545[/URL]
This is a help thread. Not a drama thread guys.
I try my best to block out the haters. I just like to think that their posts are constructive criticism.
[QUOTE=bluebull107;46137583]I try my best to block out the haters. I just like to think that their posts are constructive criticism.[/QUOTE] Would you like some lessons bluebull.
Sorry, you need to Log In to post a reply to this thread.