All pastes #400743 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-03-18 21:49 UTC
rendered paste body
WAMHud = {}
WAM = {}

WAM.ShouldDrawTable = 
{
	["CHudAmmo"] = false,
	["CHudHealth"] = false,
	["CHudBattery"] = false,
	["CHudSecondaryAmmo"] = false,
}
/*
-----------------------------------------------------------------------------------|
This script was created by Wesnc/Raven-Rave					|	
Also, Please let me know if you want to use this code in something.		|	
													|
WAM is Wesnc's Adminstration Mod							|
-----------------------------------------------------------------------------------|
*/

include("WAMInfoHud.lua")

function WAMHUD2()
	
	local client = LocalPlayer()
	if !client:Alive() then return end 
	//local mag_left = client:GetActiveWeapon():Clip1()
	//local mag_extra = client:GetAmmoCount(client:GetActiveWeapon():GetPrimaryAmmoType())
	//local secondary_ammo = client:GetAmmoCount(client:GetActiveWeapon():GetSecondaryAmmoType())
	//Script Name
	surface.CreateFont("coolvetica", 35, 500, true, true, "WAMFont" )
	surface.SetFont("WAMFont")
	draw.RoundedBox(4, 5, 5, 190, 30, Color(0, 0, 0, 225))
	draw.SimpleText("WAMInfoHud", "WAMFont", 10, 5, Color(225, 225, 225, 225), 0, 0)
	//Health, Name, and ping.
	draw.RoundedBox(4, 5, 40, 200, 140, Color(0, 0, 0, 225))
	draw.SimpleText("HP: " .. client:Health(), "ScoreboardText", 10, 40, Color(225, 225, 225, 255), 0, 0) 
	draw.SimpleText("Name: " .. client:Name(), "ScoreboardText", 10, 50, Color(225, 225, 225, 225), 0, 0)
	draw.SimpleText("Ping: " .. client:Ping(), "ScoreboardText", 10, 60, Color(225, 225, 225, 225), 0, 0)
	//Ammo
	local weapon = client:GetActiveWeapon()
		if weapon:IsValid() then
		local mag_left = weapon:Clip1()
		local mag_extra = client:GetAmmoCount(weapon:GetPrimaryAmmoType())
		local secondary_ammo = client:GetAmmoCount(weapon:GetSecondaryAmmoType())
	draw.SimpleText("Clip: " .. mag_left, "ScoreboardText", 10, 80, Color(225, 225, 225, 225), 0, 0)
	draw.SimpleText("/" .. mag_extra, "ScoreboardText", 55, 80, Color(225, 225, 225, 225), 0, 0)
	draw.SimpleText("Clip Secondary: " .. secondary_ammo, "ScoreboardText", 10, 90, Color(225, 225, 225, 225), 0, 0)
	end
	//Spaceholder
	draw.SimpleText("________________________", "ScoreboardText", 10, 100, Color(225, 225, 225, 225), 0, 0)
	//Servername, Current Gamemode, Sv_cheats, sbox_noclip
	draw.SimpleText("Servername: " .. GetConVarString( "hostname"), "ScoreboardText", 10, 115, Color(225, 225, 225, 225), 0, 0)
	//Current Gamemode
	draw.SimpleText("Current Gamemode: " .. GetConVarString( "sv_gamemode"), "ScoreboardText", 10, 125, Color(225, 225, 225, 225), 0, 0)
	draw.SimpleText("sv_cheats 1 or 0: " .. GetConVarString( "sv_cheats"), "ScoreboardText", 10, 135, Color(225, 225, 225, 225), 0, 0)
	draw.SimpleText("sbox_noclip 1 or 0: " .. GetConVarString( "sbox_noclip"), "ScoreboardText", 10, 145, Color(225, 225, 225, 225), 0, 0)
	//Credits
	draw.SimpleText("Script by Wesnc", "ScoreboardText", 10, 165, Color(225, 225, 225, 225), 0, 0)
	-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	//Message Of The Day
	//Planning to make it read from an .ini to retreive the Mes
	surface.CreateFont("akbar", 20, 100, true, true, "MOTDFont")
	surface.SetFont("MOTDFont")
	draw.RoundedBox(4, 5, 200, 205, 50, Color(0, 0, 0, 225))
	draw.SimpleText("'Never trust those whom dont", "MOTDFont", 10, 200, Color(225, 225, 225, 225), 0, 0)
	draw.SimpleText("trust others.'        	Wesnc", "MOTDFont", 10, 215, Color(225, 225, 225, 225), 0, 0)
	-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	
end

function WAM.HideDefHud( szShouldDraw )
	return WAM.ShouldDrawTable[ szShouldDraw ]
end

hook.Add("HUDShouldDraw", "WAM.HideDefaultHud", WAM.HideDefHud)

hook.Add("HUDPaint", "WAMHUD2", WAMHUD2)