PERP ERROR

Hey i got some problems with my perp server i try to setup i spawn with out anything and i keep getting this error [ERROR] gamemodes/perp/gamemode/vgui/hud.lua:236: attempt to call method ‘GetEyeTrace’ (a nil value)

  1. unknown - gamemodes/perp/gamemode/vgui/hud.lua:236
    And this
    [ERROR] lua/postprocess/overlay.lua:37: attempt to index upvalue ‘pp_mat_overlay’ (a nil value)
  2. v - lua/postprocess/overlay.lua:37
  3. unknown - lua/includes/modules/hook.lua:82

S
can please someone help me

If you want us to help you, posting some snippets of codes would help.

Have you modified PERP, or is this a blank copy?

Got a screenshot http://puu.sh/73kkj.png

[editline]20th February 2014[/editline]

it’s riot perp fils

Isn’t riot server’s PERP private?

[lua]surface.CreateFont(“PlayerNameFont”, {
size = 20,
weight = 1000,
antialias = true,
shadow = false,
font = “Tahoma”
})
surface.CreateFont(“PEChatFont”, {
size = 14,
weight = 1000,
antialias = true,
shadow = false,
font = “Tahoma”
})

function PANEL:Init ( )
self:SetAlpha(GAMEMODE.GetHUDAlpha());
self.LastDisplayCash = 0;
end

function PANEL:PerformLayout ( )
self:SetPos(0, 0);
self:SetSize(ScrW(), ScrH());
end

local doorAssosiations = {};

//local hudBG = surface.GetTextureID(“PERP2/hud/v1/hudbg”);
local hudBG = Material(“PERP2/hud/v1/GENERIC.png”)

local TypingText = surface.GetTextureID(“PERP2/hud/typing”);
local MicText = surface.GetTextureID(“PERP2/hud/mic”);
local currentlyTalkingTexture = surface.GetTextureID(“voice/icntlk_pl”);
local currentlyRadioTexture = surface.GetTextureID(“PERP2/radio”);
//
local Speed = surface.GetTextureID(“perp2/hud/speed_perp”);
local FuelN = surface.GetTextureID(“perp2/hud/fuelpointer_perp”);
local SpeedP = surface.GetTextureID(“perp2/hud/speedpointer_perp”);

function PANEL:Paint ( )

if(LocalPlayer():GetSharedBool( "warrent", false )) then
	surface.SetDrawColor( 255, 255, 255, 255 )
	surface.SetTexture( surface.GetTextureID( "perp2/wanted1" ) )
	surface.DrawTexturedRect( 10, ( ScrH() / 2 ), 75,  85 )
end

// part of HUD borrowed from Scars
if LocalPlayer():InVehicle() then
local Tbl = LocalPlayer():GetVehicle().vehicleTable;
local Width = ScrW()
local Height = ScrH()
local isWideScreen = true

if (Width / Height) <= (4 / 3) then
	isWideScreen = false
end

if Tbl then
if LocalPlayer():InVehicle() && Tbl.DF then
	CurFuel = LocalPlayer():GetVehicle():IsValid() and LocalPlayer():GetVehicle():GetSharedInt("fuel", 0) or LocalPlayer():GetFuel()
else
	CurFuel = 10000; //Setting this to full to appear that way.
end
local vel = LocalPlayer():GetVehicle():GetVelocity():Length() //math.Round(10 * 17.6)

		if isWideScreen then
		xPos = Width * 0.4114285714
		yPos = Height * 0.7142857143
		xSize = Width * 0.1785714286
		ySize = Height * 0.2857142857
	else
		xPos = Width * 0.4114285714
		yPos = Height * 0.7823142857
		xSize = Width * 0.1785714286
		ySize = Height * 0.2176870749
	end	
			
	surface.SetTexture( Speed )
	surface.SetDrawColor( 255, 255, 255, 255 )
	surface.DrawTexturedRect( xPos, yPos, xSize, ySize )	
	
	local rotation = vel * -0.184
	--speed arrow
	if isWideScreen then
		xPos = Width * 0.5007142857
		yPos = Height * 0.8571428571
		xSize = Width * 0.1785714286
		ySize = Height * 0.2857142857
	else
		xPos = Width * 0.5007142857
		--yPos = Height * 0.925170068
		yPos = Height * 0.8911564626
		xSize = Width * 0.1785714286
		ySize = Height * 0.2176870749		
	end		
	
	surface.SetTexture( SpeedP )
	surface.SetDrawColor( 255, 255, 255, 255 )
	surface.DrawTexturedRectRotated( xPos, yPos, xSize, ySize, rotation )

	--Fuel arrow
	if isWideScreen then
		xPos = Width * 0.5007142857
		yPos = Height * 0.939047619
		xSize = Width * 0.0595238095
		ySize = Height * 0.0952380952
	else
		xPos = Width * 0.5007142857
		--yPos = Height * 0.9616190476			
		yPos = Height * 0.9503854875
		xSize = Width * 0.0595238095
		ySize = Height * 0.0725714286	
	end
	

	rotation = CurFuel * -0.0114
	surface.SetTexture( FuelN )
	surface.SetDrawColor( 255, 255, 255, 255 )
	surface.DrawTexturedRectRotated( xPos , yPos, xSize, ySize, rotation )
	
end;

end

// Typing... / names and stuff
local FadePoint = ChatRadius_Local;
local RealDist = ChatRadius_Local * 1.5;

if (LocalPlayer():InVehicle()) then
	RealDist = RealDist * 2
end

surface.SetFont("PlayerNameFont");
local w, h = surface.GetTextSize("Player Name");

local ourPos = LocalPlayer():GetPos();
if (PERP_SpectatingEntity) then ourPos = PERP_SpectatingEntity:GetPos() end

local shootPos = LocalPlayer():GetShootPos();
if (PERP_SpectatingEntity) then shootPos = PERP_SpectatingEntity:GetPos() end

for k, v in pairs(player.GetAll()) do
	local vcol = v:GetColor()
	if (v != LocalPlayer() && v:Alive() && vcol.a > 0) then
		local dist = v:GetPos():Distance(ourPos);
		
		if (dist <= RealDist) then
			local trace = {}
			trace.start = shootPos;
			trace.endpos = v:GetShootPos();
			trace.filter = {LocalPlayer(), v};
			
			if (v:InVehicle()) then table.insert(trace.filter, v:GetVehicle()); end
			if (LocalPlayer():InVehicle()) then table.insert(trace.filter, LocalPlayer():GetVehicle()); end
			
			if PERP_SpectatingEntity then table.insert(trace.filter, PERP_SpectatingEntity); end

			local tr = util.TraceLine( trace ) 
			
			if (!tr.Hit) then
				local Alpha = 255;
				
				if (dist >= FadePoint) then
					local moreDist = RealDist - dist;
					local percOff = moreDist / (RealDist - FadePoint);
					
					Alpha = 255 * percOff;
				end
				
				local AttachmentPoint = v:GetAttachment(v:LookupAttachment('eyes'));
				if !AttachmentPoint then AttachmentPoint = v:GetAttachment(v:LookupAttachment('head')); end
				
				if (AttachmentPoint) then 
					local realPos = Vector(v:GetPos().x, v:GetPos().y, AttachmentPoint.Pos.z + 10);
					local screenPos = realPos:ToScreen();
					
					//if (v:GetSharedString("typing", 0) == 1) then					
					if(v:IsTyping()) then
						local pointDown = (realPos + Vector(0, 0, math.sin(CurTime() * 2) * 3)):ToScreen()
						local pointUp = (realPos + Vector(0, 0, 20 + math.sin(CurTime() * 2) * 3)):ToScreen() 
						
						local Size = math.abs(pointDown.y - pointUp.y);
						
						surface.SetDrawColor(255, 255, 255, Alpha);
						surface.SetTexture(TypingText);
						surface.DrawTexturedRect(pointUp.x - Size * .5, pointUp.y, Size, Size);
					elseif GAMEMODE.Options_ShowNames:GetBool() then
						local color = team.GetColor(v:Team());
						
						draw.SimpleTextOutlined(v:GetRPName(), "PlayerNameFont", screenPos.x, screenPos.y - h, Color(255, 255, 255, Alpha), 1, 1, 1, Color(color.r, color.g, color.b, Alpha));
						
						if (v:InVehicle()) then
							if (LocalPlayer():Team() == TEAM_POLICE) then
								local Speed = math.Round(v:GetVehicle():GetVelocity():Length() / 17.6)
								local c = Color(255, 255, 255, Alpha)
								if(v:GetVehicle():IsInInnerCity() and Speed > GAMEMODE.GetInnerCitySpeedLimit()) then
									c = Color(255, 200, 0, Alpha)
									
									if(Speed > GAMEMODE.GetInnerCitySpeedLimit() + 10) then
										c = Color(255, 0, 0, Alpha)
									end
								elseif(not v:GetVehicle():IsInInnerCity() and Speed > GAMEMODE.GetOutterCitySpeedLimit()) then
									c = Color(255, 200, 0, Alpha)
										
									if(Speed > GAMEMODE.GetOutterCitySpeedLimit() + 10) then
										c = Color(255, 0, 0, Alpha)
									end
								end
								draw.SimpleTextOutlined(SpeedText(Speed), "PlayerNameFont", screenPos.x, screenPos.y - h * 2, c, 1, 1, 1, c)
							end
						else
							local orgName = v:GetOrganizationName();
							if (orgName && orgName != '' and orgName != 'New Organization') then
								draw.SimpleTextOutlined(orgName, "PlayerNameFont", screenPos.x, screenPos.y - h * 2, Color(255, 255, 255, Alpha), 1, 1, 1, Color(255, 0, 0, Alpha));
							end
						end
						
						if (v:GetSharedBool("warrent", false)) then
							draw.SimpleTextOutlined("Arrest Warrent", "PlayerNameFont", screenPos.x, screenPos.y, Color(255, 255, 255, Alpha), 1, 1, 1, Color(color.r, color.g, color.b, Alpha));
						end
					end
				end
			end
		end
	end
end

// Door Stuff / Vehicles
local FadePoint = FadePoint * .5;
local RealDist = RealDist * .5;

local eyeTrace = LocalPlayer():GetEyeTrace();

if (!LocalPlayer():InVehicle() && GAMEMODE.Options_ShowNames:GetBool() && eyeTrace.Entity && IsValid(eyeTrace.Entity) && (eyeTrace.Entity:IsDoor() || eyeTrace.Entity:IsVehicle())) then
	local dist = eyeTrace.Entity:GetPos():Distance(ourPos);
	
	if (dist <= RealDist) then
		local Alpha = 255;
				
		if (dist >= FadePoint) then
			local moreDist = RealDist - dist;
			local percOff = moreDist / (RealDist - FadePoint);
					
			Alpha = 255 * percOff;
		end
		
		if (eyeTrace.Entity:IsDoor()) then
			local Pos = eyeTrace.Entity:LocalToWorld(eyeTrace.Entity:OBBCenter()):ToScreen();
			local doorTable = eyeTrace.Entity:GetPropertyTable();

			if (doorTable) then			
				local doorOwner = eyeTrace.Entity:GetDoorOwner();
				
				if (!doorOwner || !IsValid(doorOwner)) then
					draw.SimpleTextOutlined('For Sale', "perp2_RealtorFontNew", Pos.x, Pos.y, Color(255, 255, 255, Alpha), 1, 1, 1, Color(0, 100, 0, Alpha));
					draw.SimpleTextOutlined(doorTable.Name, "perp2_RealtorFontNew", Pos.x, Pos.y + 25, Color(255, 255, 255, Alpha), 1, 1, 1, Color(0, 100, 0, Alpha));
				else
					local orgname = doorOwner:GetOrganizationName()
					if(orgname and orgname != "New Orginization") then
						draw.SimpleTextOutlined(orgname, "perp2_RealtorFontNew", Pos.x, Pos.y - 25, Color(255, 255, 255, Alpha), 1, 1, 1, Color(10, 10, 255, Alpha));
					end
					draw.SimpleTextOutlined('Owned By ' .. doorOwner:GetRPName(), "perp2_RealtorFontNew", Pos.x, Pos.y, Color(255, 255, 255, Alpha), 1, 1, 1, Color(255, 0, 0, Alpha));
					draw.SimpleTextOutlined(doorTable.Name, "perp2_RealtorFontNew", Pos.x, Pos.y + 25, Color(255, 255, 255, Alpha), 1, 1, 1, Color(255, 0, 0, Alpha));
				end
			elseif (GAMEMODE.Options_ShowUnownableDoors:GetBool()) then
				if (eyeTrace.Entity:IsPoliceDoor()) then
					draw.SimpleTextOutlined('Owned By EvoCity Municipal Government', "perp2_RealtorFontNew", Pos.x, Pos.y, Color(255, 255, 255, Alpha), 1, 1, 1, Color(255, 0, 0, Alpha));
				elseif (eyeTrace.Entity:IsCivilDoor()) then
					draw.SimpleTextOutlined('Owned By EvoCity Civil Services', "perp2_RealtorFontNew", Pos.x, Pos.y, Color(255, 255, 255, Alpha), 1, 1, 1, Color(255, 0, 0, Alpha));
				elseif (eyeTrace.Entity:IsClubDoor()) then
					draw.SimpleTextOutlined("Izzie's Palace Nightclub -- Under Construction", "perp2_RealtorFontNew", Pos.x, Pos.y, Color(255, 255, 255, Alpha), 1, 1, 1, Color(255, 0, 0, Alpha));
				else
					draw.SimpleTextOutlined('Unownable', "perp2_RealtorFontNew", Pos.x, Pos.y, Color(255, 255, 255, Alpha), 1, 1, 1, Color(255, 0, 0, Alpha));
				end
			end
		elseif (eyeTrace.Entity:GetTrueOwner() && IsValid(eyeTrace.Entity:GetTrueOwner()) && eyeTrace.Entity:GetTrueOwner().GetRPName) then
			local Pos = eyeTrace.Entity:LocalToWorld(Vector(eyeTrace.Entity:OBBCenter().x, eyeTrace.Entity:OBBCenter().y, eyeTrace.Entity:OBBMaxs().z + 15)):ToScreen()
			local orgname = eyeTrace.Entity:GetTrueOwner():GetOrganizationName()
			if(orgname and orgname != "New Organization") then
				draw.SimpleTextOutlined(orgname, "perp2_RealtorFontNew", Pos.x, Pos.y - 25, Color(255, 255, 255, Alpha), 1, 1, 1, Color(0, 0, 255, Alpha));
			end
			if(eyeTrace.Entity:GetTrueOwner():GetSharedEntity("DemoVehicle", nil) == eyeTrace.Entity) then
				draw.SimpleTextOutlined('Demoed By ' .. eyeTrace.Entity:GetTrueOwner():GetRPName(), "perp2_RealtorFontNew", Pos.x, Pos.y, Color(255, 255, 255, Alpha), 1, 1, 1, Color(255, 120, 0, Alpha));
			else
				draw.SimpleTextOutlined('Owned By ' .. eyeTrace.Entity:GetTrueOwner():GetRPName(), "perp2_RealtorFontNew", Pos.x, Pos.y, Color(255, 255, 255, Alpha), 1, 1, 1, Color(255, 0, 0, Alpha));
			end
		end
	end
end

// Arrested
if (GAMEMODE.UnarrestTime) then
	if (GAMEMODE.UnarrestTime < CurTime()) then GAMEMODE.UnarrestTime = nil; else
		local timeLeft = math.ceil(GAMEMODE.UnarrestTime - CurTime());
		
		draw.SimpleText('You are arrested for another ' .. timeLeft .. ' seconds.', 'RealtorFont', ScrW() * .5, ScrH() * .25, Color(100+ 100 * math.abs(math.sin(CurTime())), 0, 0, 255), 1, 1);
	end
end

// HUD
local fader = math.abs(math.sin(CurTime() * 2));
local border = 0;
local availableWidth = self:GetWide();
local widthPer = (availableWidth / 7);
local heightPer = widthPer * .33;

surface.SetDrawColor(GAMEMODE.GetHUDColorR(), GAMEMODE.GetHUDColorG(), GAMEMODE.GetHUDColorB(), 255);
	
//surface.SetTexture(hudBG);
surface.SetMaterial(hudBG)
surface.DrawTexturedRect(border, self:GetTall() - border - heightPer + 10, widthPer, heightPer);

//surface.SetTexture(hudBG);
surface.SetMaterial(hudBG)
surface.DrawTexturedRect(widthPer, self:GetTall() - border - heightPer + 10, widthPer, heightPer);

//surface.SetTexture(hudBG);
surface.SetMaterial(hudBG)
surface.DrawTexturedRect(widthPer * 2, self:GetTall() - border - heightPer + 10, widthPer, heightPer);

//surface.SetTexture(hudBG);
surface.SetMaterial(hudBG)
surface.DrawTexturedRect(widthPer * 3, self:GetTall() - border - heightPer + 10, widthPer, heightPer);

//surface.SetTexture(hudBG);
surface.SetMaterial(hudBG)
surface.DrawTexturedRect(widthPer * 4, self:GetTall() - border - heightPer + 10, widthPer, heightPer);

//surface.SetTexture(hudBG);
surface.SetMaterial(hudBG)
surface.DrawTexturedRect(widthPer * 5, self:GetTall() - border - heightPer + 10, widthPer, heightPer);

//surface.SetTexture(hudBG);
surface.SetMaterial(hudBG)
surface.DrawTexturedRect(widthPer * 6, self:GetTall() - border - heightPer + 10, widthPer, heightPer);

local healthStatus = "Healthy";
local health = LocalPlayer():Health();

if (health < 1) then healthStatus = "Unconcious";
elseif (health < 20) then healthStatus = "Critically Injured";
elseif (health < 40) then healthStatus = "Majorly Injured";
elseif (health < 60) then healthStatus = "Badly Injured";
elseif (health < 80) then healthStatus = "Mildly Injured";
elseif (health < 90) then healthStatus = "Slightly Injured";
elseif (health < 100) then healthStatus	= "Slightly Bruised";
end

local percent = health / 100;

local color = math.Clamp(percent * 255, 0, 255);
draw.SimpleText("Health", "perp2_TextHUDBig", border + widthPer * .5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
draw.SimpleText(healthStatus, "perp2_TextHUDSmall", border + widthPer * .5, self:GetTall() - border - heightPer * .25, Color(255 - color, color, 0, 200), 1, 1);


local armorStatus = "Fully Armored";
local armor = LocalPlayer():Armor();

if (armor < 1) then armorStatus = "None";
elseif (armor < 20) then armorStatus = "Slightly Armored";
elseif (armor < 40) then armorStatus = "Lightly Armored";
elseif (armor < 60) then armorStatus = "Moderately Armored";
elseif (armor < 80) then armorStatus = "Heavily Armored";
elseif (armor < 90) then armorStatus = "Extremely Armored";
elseif (armor < 100) then armorStatus	= "Fully Armored";
end

local percent2 = armor / 100;
local color2 = math.Clamp(percent2 * 255, 0, 255);

draw.SimpleText("Armor", "perp2_TextHUDBig", border + widthPer * 1.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
draw.SimpleText(armorStatus, "perp2_TextHUDSmall", border + widthPer * 1.5, self:GetTall() - border - heightPer * .25, Color(255 - color2, 0, color2, 200), 1, 1);

local staminaStatus = LocalPlayer().Stamina
local color3 = staminaStatus * 2;

if (ClientZombieCheck) then // Zombie (Infinite Stamina)
	draw.SimpleText("Stamina", "perp2_TextHUDBig", border * 2 + widthPer * 2.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
	draw.SimpleText("Infinite", "perp2_TextHUDSmall", border * 2 + widthPer * 2.5, self:GetTall() - border - heightPer * .25, Color(255, 255, 255, 200 * fader), 1, 1);
else
	draw.SimpleText("Stamina", "perp2_TextHUDBig", border * 2 + widthPer * 2.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
	draw.SimpleText((staminaStatus or 100), "perp2_TextHUDSmall", border * 2 + widthPer * 2.5, self:GetTall() - border - heightPer * .25, Color(255, 255, 255, color3), 1, 1);
end;

if (LocalPlayer():GetPrivateInt("gpoints", 0) != 0) then
	local wht = math.Clamp((255 * .5) + (math.sin(CurTime() * 3) * 255 * .5), 0, 255);

	if (LocalPlayer():GetPrivateInt("gpoints", 0) == 1) then
		draw.SimpleText("Genes", "perp2_TextHUDBig", border * 3 + widthPer * 3.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
		draw.SimpleText(LocalPlayer():GetPrivateInt("gpoints", 0) .. " Gene Available (F2)", "perp2_TextHUDSmall", border * 3 + widthPer * 3.5, self:GetTall() - border - heightPer * .25, Color(255, wht, wht, 200), 1, 1);
	else
		draw.SimpleText("Genes", "perp2_TextHUDBig", border * 3 + widthPer * 3.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
		draw.SimpleText(LocalPlayer():GetPrivateInt("gpoints", 0) .. " Genes Available (F2)", "perp2_TextHUDSmall", border * 3 + widthPer * 3.5, self:GetTall() - border - heightPer * .25, Color(255, wht, wht, 200), 1, 1);
	end
elseif (LocalPlayer():InVehicle()) then
	draw.SimpleText("Speed", "perp2_TextHUDBig", border * 3 + widthPer * 3.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
	local Speed = math.Round(LocalPlayer():GetVehicle():GetVelocity():Length() / 17.6);
	local speednum = tostring(math.Round(LocalPlayer():GetVehicle():GetVelocity():Length() / 17.6))
	
	local c = Color(255, 255, 255, Alpha)
	local bWarn = false
	if(LocalPlayer():GetVehicle():IsInInnerCity() and Speed > GAMEMODE.GetInnerCitySpeedLimit()) then
		c = Color(255, 200, 0, Alpha)
		if(Speed > GAMEMODE.GetInnerCitySpeedLimit() + 10) then
			c = Color(255, 0, 0, Alpha)
		end
		bWarn = true
	elseif(not LocalPlayer():GetVehicle():IsInInnerCity() and Speed > GAMEMODE.GetOutterCitySpeedLimit()) then
		c = Color(255, 200, 0, Alpha)
		if(Speed > GAMEMODE.GetOutterCitySpeedLimit() + 10) then
			c = Color(255, 0, 0, Alpha)
		end
		bWarn = true
	end
	if(bWarn) then
		draw.SimpleTextOutlined("Your speed is above the legal speed limit in this area!", "HUDFont", ScrW() * 0.5, ScrH() - (ScrH() * 0.1 * 0.5) - 4, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 2, Color(25, 25, 25, 255))
	end
	draw.SimpleText(SpeedText(speednum), "perp2_TextHUDSmall", ScrW() * 0.5, self:GetTall() - border - heightPer * .25, Color(255, 255, 255, 200), 1, 1);
else
	local formattedTime = "0 Seconds";
	local timePlayed = LocalPlayer():GetTimePlayed();
	
	local numMonths = math.floor(timePlayed / (60 * 60 * 24 * 31));
	local numWeeks = math.floor(timePlayed / (60 * 60 * 24 * 7));
	local numDays = math.floor(timePlayed / (60 * 60 * 24));
	local numHours = math.floor(timePlayed / (60 * 60));
	local numMinutes = math.floor(timePlayed / 60);
	local numSeconds = math.floor(timePlayed);
	
	if (numMonths != 0) then formattedTime = numMonths .. " Month"; if (numMonths > 1) then formattedTime = formattedTime .. "s" end
	elseif (numWeeks != 0) then formattedTime = numWeeks .. " Week"; if (numWeeks > 1) then formattedTime = formattedTime .. "s" end
	elseif (numDays != 0) then formattedTime = numDays .. " Day";  if (numDays > 1) then formattedTime = formattedTime .. "s" end
	elseif (numHours != 0) then formattedTime = numHours .. " Hour";  if (numHours > 1) then formattedTime = formattedTime .. "s" end
	elseif (numMinutes != 0) then formattedTime = numMinutes .. " Minute";  if (numMinutes > 1) then formattedTime = formattedTime .. "s" end
	else formattedTime = numSeconds .. " Second"; if (numSeconds > 1) then formattedTime = formattedTime .. "s" end end
	
	draw.SimpleText("Time Played", "perp2_TextHUDBig", border * 3 + widthPer * 3.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
	draw.SimpleText(formattedTime, "perp2_TextHUDSmall", border * 3 + widthPer * 3.5, self:GetTall() - border - heightPer * .25, Color(255, 255, 255, 200), 1, 1);
end

if (LocalPlayer():GetCash() > self.LastDisplayCash) then
	if (LocalPlayer():GetCash() - self.LastDisplayCash) > 10000 then
		self.LastDisplayCash = self.LastDisplayCash + 1000;
	elseif (LocalPlayer():GetCash() - self.LastDisplayCash) > 1000 then
		self.LastDisplayCash = self.LastDisplayCash + 100;
	elseif (LocalPlayer():GetCash() - self.LastDisplayCash) > 100 then
		self.LastDisplayCash = self.LastDisplayCash + 10;
	else
		self.LastDisplayCash = self.LastDisplayCash + 1;
	end
elseif (LocalPlayer():GetCash() < self.LastDisplayCash) then
	if (self.LastDisplayCash - LocalPlayer():GetCash()) > 10000 then
		self.LastDisplayCash = self.LastDisplayCash - 1000;
	elseif (self.LastDisplayCash - LocalPlayer():GetCash()) > 1000 then
		self.LastDisplayCash = self.LastDisplayCash - 100;
	elseif (self.LastDisplayCash - LocalPlayer():GetCash()) > 100 then
		self.LastDisplayCash = self.LastDisplayCash - 10;
	else
		self.LastDisplayCash = self.LastDisplayCash - 1;
	end
end

draw.SimpleText("Money", "perp2_TextHUDBig", border * 4+ widthPer * 4.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
draw.SimpleText(DollarSign() .. self.LastDisplayCash, "perp2_TextHUDSmall", border * 4 + widthPer * 4.5, self:GetTall() - border - heightPer * .25, Color(255, 255, 255, 200), 1, 1);

// Fuel
local CurFuel = LocalPlayer():GetVehicle():IsValid() and LocalPlayer():GetVehicle():GetSharedInt("fuel", 0) or 0
draw.SimpleText("Fuel", "perp2_TextHUDBig", border * 5 + widthPer * 5.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
if( LocalPlayer():InVehicle() and LocalPlayer():GetVehicle():IsValid() and LocalPlayer():GetVehicle():GetClass() == "prop_vehicle_jeep" ) then
	draw.SimpleText(math.Round(CurFuel)*.01, "perp2_TextHUDSmall", border * 5 + widthPer * 5.5, self:GetTall() - border - heightPer * .25, Color(0, 191, 255, 50 * fader), 1, 1);
else
	draw.SimpleText("None", "perp2_TextHUDSmall", border * 5 + widthPer * 5.5, self:GetTall() - border - heightPer * .25, Color(255, 0, 0, 200), 1, 1);
end

local text = "No Weapon";
if (LocalPlayer():Alive() && LocalPlayer():GetActiveWeapon() && LocalPlayer():GetActiveWeapon().Clip1) then
	local clip1 = LocalPlayer():GetActiveWeapon():Clip1();
	local ammo = LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType());
	
	if (clip1 == -1) then
		text = "Unlimited Ammo";
	else
		text = clip1 .. " / " .. ammo;
	end
	
	if (LocalPlayer():GetActiveWeapon():GetClass() == "weapon_physcannon") then
		text = "Unlimited Ammo";
	elseif (LocalPlayer():GetActiveWeapon():GetClass() == "weapon_perp_paramedic_defib") then
		self.lastChargeDisp = self.lastChargeDisp or 0;
		
		if (self.lastChargeDisp > LocalPlayer():GetActiveWeapon().ChargeAmmount) then
			self.lastChargeDisp = self.lastChargeDisp - 1;
		elseif (self.lastChargeDisp < LocalPlayer():GetActiveWeapon().ChargeAmmount) then
			self.lastChargeDisp = self.lastChargeDisp + 1;
		end
		
		text = "Charge: " .. self.lastChargeDisp .. "%";
	elseif (LocalPlayer():GetActiveWeapon():GetClass() == "weapon_perp_paramedic_health") then
		if (LocalPlayer():GetActiveWeapon().LastUse && LocalPlayer():GetActiveWeapon().LastUse + 10 > CurTime()) then
			local left = math.Clamp(math.ceil(10 - (CurTime() - LocalPlayer():GetActiveWeapon().LastUse)), 1, 10);
			
			if (last == 1) then
				text = "Ready In " .. math.ceil(10 - (CurTime() - LocalPlayer():GetActiveWeapon().LastUse)) .. " Second";
			else
				text = "Ready In " .. math.ceil(10 - (CurTime() - LocalPlayer():GetActiveWeapon().LastUse)) .. " Seconds";
			end
		else
			text = "Ready";
		end
	end
end	

if( LocalPlayer():InVehicle() and IsValid( LocalPlayer():GetVehicle() ) ) then
	draw.SimpleText("Cruise Control", "perp2_TextHUDBig", border * 5 + widthPer * 6.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
	if( LocalPlayer():GetVehicle():GetSharedInt("CruiseControl", 0) == 1 ) then
		draw.SimpleText( LocalPlayer():GetVehicle():GetSharedInt("CruiseControlValue"), "perp2_TextHUDSmall", border * 5 + widthPer * 6.5, self:GetTall() - border - heightPer * .25, Color(255, 255, 255, 200), 1, 1);	
	else
		draw.SimpleText("Off", "perp2_TextHUDSmall", border * 5 + widthPer * 6.5, self:GetTall() - border - heightPer * .25, Color(255, 0, 0, 200), 1, 1);	
	end
else
	draw.SimpleText("Ammunition", "perp2_TextHUDBig", border * 5 + widthPer * 6.5, self:GetTall() - border - heightPer * .45, Color(255, 255, 255, 50), 1, 1);
	draw.SimpleText(text, "perp2_TextHUDSmall", border * 5 + widthPer * 6.5, self:GetTall() - border - heightPer * .25, Color(255, 255, 255, 200), 1, 1);
end

// talking
if (GAMEMODE.CurrentlyTalking) then
	surface.SetDrawColor(255, 255, 255, 255);
	surface.SetTexture(currentlyTalkingTexture);
	surface.DrawTexturedRect(5, 5, ScrH() * .1, ScrH() * .1);
end

if (LocalPlayer():Team() != TEAM_CITIZEN && LocalPlayer():GetSharedBool("tradio", false)) then
	surface.SetDrawColor(255, 255, 255, 255);
	surface.SetTexture(currentlyRadioTexture);
	surface.DrawTexturedRect(10 + ScrH() * .1, 5, ScrH() * .1, ScrH() * .1);
end

// Chat
local xBuffer = 160;
local ChatFont = "PEChatFont"

surface.SetFont(ChatFont);
local _, y = surface.GetTextSize("what");
local startY = self:GetTall() - border * 10 - heightPer - y - 8;

if (GAMEMODE.ChatBoxOpen) then
	local ourType = "Local";
	if (GAMEMODE.chatBoxIsOOC) then ourType = "OOC"; end
	
	local drawText = GAMEMODE.chatBoxText;
	
	for k, v in pairs(GAMEMODE.chatPrefixes) do
		if (string.match(string.lower(GAMEMODE.chatBoxText), "^[ 	]*[!/]" .. string.lower(k))) then
			
			ourType = v;
			drawText = string.Trim(string.sub(string.Trim(drawText), string.len(k) + 2));
			
			break;
		end
	end

	surface.SetFont(ChatFont);
	local x, y = surface.GetTextSize(ourType .. ": " .. drawText);
	
	draw.RoundedBox(4, xBuffer, startY, x + 10, y, Color(255, 255, 255, 200))
	
	if (math.sin(CurTime() * 5) * 10) > 0 then
		drawText = drawText .. "|";
	end
	
	draw.SimpleText(ourType .. ": " .. drawText, ChatFont, xBuffer + 4, startY + y * .5, Color(0, 0, 0, 200), 0, 1);
	draw.SimpleText(ourType .. ": " .. drawText, ChatFont, xBuffer + 4, startY + y * .5, Color(0, 0, 0, 200), 0, 1);
end

if (#GAMEMODE.chatRecord > 0) then
	for i = math.Clamp(#GAMEMODE.chatRecord - GAMEMODE.linesToShow, 1, #GAMEMODE.chatRecord), #GAMEMODE.chatRecord do
		local tab = GAMEMODE.chatRecord*;
		
		if (GAMEMODE.ChatBoxOpen || tab[1] + 15 >= CurTime()) then
			local Alpha = 255;
			
			if (!GAMEMODE.ChatBoxOpen && tab[1] + 10 < CurTime()) then
				local TimeLeft = tab[1] + 15 - CurTime();
				Alpha = (255 / 5) * TimeLeft;
			end

			local posX, posY = xBuffer, startY - y * (1.5 + (#GAMEMODE.chatRecord - i));
			
			if tab[3] then
				local col = Color(tab[3].r, tab[3].g, tab[3].b, Alpha);
				
				draw.SimpleText(tab[2] .. ": ", ChatFont, posX + 1, posY + 1, Color(0, 0, 0, Alpha), 2);
				draw.SimpleText(tab[2] .. ": ", ChatFont, posX + 1, posY + 1, Color(0, 0, 0, Alpha), 2);
				
				if (tab[6]) then
					local Cos = math.abs(math.sin(CurTime() * 2));
					
					draw.SimpleTextOutlined(tab[2] .. ": ", ChatFont, posX, posY, col, 2, 0, 1, Color(Cos * tab[6].r, Cos * tab[6].g, Cos * tab[6].b, math.Clamp(Alpha * Cos, 0, 255)));
					draw.SimpleTextOutlined(tab[2] .. ": ", ChatFont, posX, posY, col, 2, 0, 1, Color(Cos * tab[6].r, Cos * tab[6].g, Cos * tab[6].b, math.Clamp(Alpha * Cos, 0, 255)));
				else
					draw.SimpleText(tab[2] .. ": ", ChatFont, posX, posY, col, 2);
					draw.SimpleText(tab[2] .. ": ", ChatFont, posX, posY, col, 2);
				end
			end
			
			local col = Color(tab[5].r, tab[5].g, tab[5].b, Alpha);
			draw.SimpleText(tab[4], ChatFont, posX + 1, posY + 1, Color(0, 0, 0, Alpha));
			draw.SimpleText(tab[4], ChatFont, posX + 1, posY + 1, Color(0, 0, 0, Alpha));
			draw.SimpleText(tab[4], ChatFont, posX, posY, col);
			draw.SimpleText(tab[4], ChatFont, posX, posY, col);
		end
	end
end

end

vgui.Register(“perp2_hud”, PANEL);

[editline]20th February 2014[/editline]

–[[---------------------------------------------------------
Register the convars that will control this effect
-----------------------------------------------------------]]
local pp_mat_overlay = CreateClientConVar( “pp_mat_overlay”, “”, false, false )
local pp_mat_overlay_refractamount = CreateClientConVar( “pp_mat_overlay_refractamount”, “0.3”, false, false )

local lastTexture = nil
local mat_Overlay = nil

function DrawMaterialOverlay( texture, refractamount )

if (texture ~= lastTexture or mat_Overlay == nil) then
	mat_Overlay = Material( texture )
	lastTexture = texture
end

if (mat_Overlay == nil) then return end

render.UpdateScreenEffectTexture()

mat_Overlay:SetFloat("$envmap",			0)
mat_Overlay:SetFloat("$envmaptint",		0)
mat_Overlay:SetFloat("$refractamount",	refractamount)
mat_Overlay:SetInt("$ignorez",		1)

render.SetMaterial( mat_Overlay )
render.DrawScreenQuad()

end

local function DrawInternal()

local overlay = pp_mat_overlay:GetString()

if ( overlay == "" ) then return end
if ( !GAMEMODE:PostProcessPermitted( "material overlay" ) ) then return end

DrawMaterialOverlay( 
		overlay, 
		pp_mat_overlay_refractamount:GetFloat()	);

end

hook.Add( “RenderScreenspaceEffects”, “RenderMaterialOverlay”, DrawInternal )

list.Set( “OverlayMaterials”, “waterfall”, { Material = “models/shadertest/shader3”, Icon = “models/shadertest/shader3” } )
list.Set( “OverlayMaterials”, “jelly”, { Material = “models/shadertest/shader4”, Icon = “models/shadertest/shader4” } )
list.Set( “OverlayMaterials”, “stained glass”, { Material = “models/shadertest/shader5”, Icon = “models/shadertest/shader5” } )
list.Set( “OverlayMaterials”, “statis”, { Material = “models/props_combine/stasisshield_sheet”, Icon = “models/props_combine/stasisshield_sheet” } )
list.Set( “OverlayMaterials”, “shield”, { Material = “models/props_combine/com_shield001a”, Icon = “models/props_combine/com_shield001a” } )
list.Set( “OverlayMaterials”, “froested”, { Material = “models/props_c17/frostedglass_01a”, Icon = “models/props_c17/frostedglass_01a” } )
list.Set( “OverlayMaterials”, “tankglass”, { Material = “models/props_lab/Tank_Glass001”, Icon = “models/props_lab/Tank_Glass001” } )
list.Set( “OverlayMaterials”, “globe”, { Material = “models/props_combine/tprings_globe”, Icon = “models/props_combine/tprings_globe” } )
list.Set( “OverlayMaterials”, “fisheye”, { Material = “models/props_c17/fisheyelens”, Icon = “models/props_c17/fisheyelens” } )
list.Set( “OverlayMaterials”, “rendertarget”, { Material = “models/overlay_rendertarget”, Icon = “models/overlay_rendertarget” } )

list.Set( “PostProcess”, “Overlay”,
{
category = “Overlay”,

func = function( content )

	for k, overlay in pairs( list.Get( "OverlayMaterials" ) ) do
	
		spawnmenu.CreateContentIcon( "postprocess", content, 
		{ 
			name	= "Overlay",
			icon	= overlay.Icon,
			convars = 
			{
				pp_mat_overlay = 
				{
					on = overlay.Material,
					off = ""
				}
			}
		})	
		
	end 

end,

cpanel		= function( CPanel )

	CPanel:AddControl( "Header", { Text = "#Material_Overlay", Description = "#Material_Overlay_Information" }  )		
	CPanel:AddControl( "Slider", { Label = "#Material_Overlay_RefractAmount", Command = "pp_mat_overlay_refractamount", Type = "Float", Min = "-1", Max = "1" }  )	
	
end,

})

[editline]20th February 2014[/editline]

local gmod = gmod
local pairs = pairs
local isfunction = isfunction
local isstring = isstring
local IsValid = IsValid

module( “hook” )

Hooks = {}


– For access to the Hooks table… for some reason.

function GetTable() return Hooks end


– Add a hook

function Add( event_name, name, func )

if ( !isfunction( func ) ) then return end
if ( !isstring( event_name ) ) then return end

if (Hooks[ event_name ] == nil) then
	Hooks[ event_name ] = {}
end

Hooks[ event_name ][ name ] = func

end


– Remove a hook

function Remove( event_name, name )

if ( !isstring( event_name ) ) then return end
if ( !Hooks[ event_name ] ) then return end

Hooks[ event_name ][ name ] = nil

end


– Run a hook (this replaces Call)

function Run( name, … )
return Call( name, nil, … )
end


– Called by the engine

function Call( name, gm, … )

local ret

--
-- If called from hook.Run then gm will be nil.
--
if ( gm == nil && gmod != nil ) then
	gm = gmod.GetGamemode()
end

--
-- Run hooks
--
local HookTable = Hooks[ name ]
if ( HookTable != nil ) then

	local a, b, c, d, e, f;

	for k, v in pairs( HookTable ) do 
		
		if ( isstring( k ) ) then
			
			--
			-- If it's a string, it's cool
			--
			a, b, c, d, e, f = v( ... )

		else

			--
			-- If the key isn't a string - we assume it to be an entity
			-- Or panel, or something else that IsValid works on.
			--
			if ( IsValid( k ) ) then
				--
				-- If the object is valid - pass it as the first argument (self)
				--
				a, b, c, d, e, f = v( k, ... )
			else
				--
				-- If the object has become invalid - remove it
				--
				HookTable[ k ] = nil
			end
		end

		--
		-- Hook returned a value - it overrides the gamemode function
		--
		if ( a != nil ) then
			return a, b, c, d, e, f
		end
		
	end
end

--
-- Call the gamemode function
--
if ( !gm ) then return end

local GamemodeFunction = gm[ name ]
if ( GamemodeFunction == nil ) then return end
	
return GamemodeFunction( gm, ... )	

end[/lua]
[/QUOTE]

[editline]20th February 2014[/editline]

the fills has being leak just before new year

Not alot of people will help you to fix a leaked script.

Yeah, this is leaked, but in future, use [lua] tags when posting Lua.

[lua]
function like()
local function this()
print(“m’kay?”)
end

this()

end
[/lua]

alright sry

Ohh, thats just perp, that error is ment to be there…

Okay do you know why i spawn with nothing and some of npc nothing pups up my man is just looking at him and can get out

ITS PERP, AND IT’S A LEAKED GAME MODE SO JUST CLOSE THIS THREAD

Yeh it’s a feature, not a bug, just leave it, it’s fine :slight_smile:

Hello cybrax, this is due to the Database failing to connect i believe, correct me if i’m wrong.


(User was banned for this post ("dumb bump" - postal))