Error fixes!

I get these errors:


ERROR 1#
ShaderAPIDX8::CreateD3DTexture: E_OUTOFMEMORY
I'm getting this error after 2 minutes on the server.


ERROR 2#
[ERROR] gamemodes/base/gamemode/cl_init.lua:66: attempt to call method 'Clip1' (a nil value)
  1. unknown - gamemodes/base/gamemode/cl_init.lua:66

This is an error i get everytime i die!

init.lua
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "money_system.lua" )
AddCSLuaFile( "level_system.lua" )
AddCSLuaFile( "player.lua" )
AddCSLuaFile( "menu.lua" )
AddCSLuaFile( "class.lua" )
AddCSLuaFile( "function.lua" )
AddCSLuaFile( "skill_buff.lua" )
AddCSLuaFile( "radar.lua" )

include( 'radar.lua' )
include( 'skill_buff.lua' )
include( 'money_system.lua' )
include( 'level_system.lua' )
include( 'shared.lua' )
include( 'player.lua' )
include( 'menu.lua' )
include( 'function.lua' )



function GM:ShowSpare2( ply )
	umsg.Start( "MyMenu", ply )
	umsg.End()
end
hook.Add("ShowSpare2", "F4Menu", MyMenu)

function GM:PlayerSpawn( ply )
    self.BaseClass:PlayerSpawn( ply )
	local armor = ply:GetLevel()*5	
	ply:SetRace(0)
	ply:SetTeam(1)
	ply:SetArmor(armor)
	ply:SetGravity  ( 0 )
    ply:SetWalkSpeed( 300 )
    ply:SetRunSpeed ( 500 )
	ply:StripWeapons()
	ply:Give("weapon_rpg")
	ply:Give("weapon_pistol")
	ply:GiveAmmo(250, "pistol")
	ply:SkillBuff()
end

function GM:PlayerDeath( Victim, Inflictor, Attacker )
	self.BaseClass:PlayerDeath( Victim, Inflictor, Attacker)
	attacker:AddExp(25)
	if Attacker == Victim then
		print("You get nothing for killing yourself!")
	end	
end
	
	

function GM:PlayerInitialSpawn( ply )
	self.BaseClass:PlayerInitialSpawn( ply )
	ply:PrintMessage( HUD_PRINTTALK, "Welcome, " .. ply:Name() .. "!" )
	
	---- Start amounts	
	MONEY_STARTAMOUNT = 1000
	LEVEL_STARTAMOUNT = 1
	EXP_STARTAMOUNT = 0
	SKILL_STARTAMOUNT = 1
	RACE_STARTRACE = 0
	
	-----Level && Exp
	local exp = ply:GetPData("exp")
	local level = ply:GetPData("level")
	local cash = ply:GetPData("money")
	local skill = ply:GetPData("skilllevel")
	local Level = ply:GetLevel()
	----------------------------
	local s1 = ply:GetPData(ply:GetRace(1).."s1")
	local s2 = ply:GetPData(ply:GetRace(1).."s2")
	local s3 = ply:GetPData(ply:GetRace(1).."s3")
	local s4 = ply:GetPData(ply:GetRace(1).."s4")
	if s1 == nil then ply:SetSkills(0, 1) end
	if s2 == nil then ply:SetSkills(0, 2) end
	if s3 == nil then ply:SetSkills(0, 3) end
	if s4 == nil then ply:SetSkills(0, 4) end
	ply:SetRace(0)
	
	----------------------------
	
	if skill == nil then
	ply:SetPData("skilllevel", SKILL_STARTAMOUNT)
	ply:SetSkillLevel( SKILL_STARTAMOUNT )
	else
	ply:SetSkillLevel( skill )
	end
	
	if level == nil then
	ply:SetPData("level", LEVEL_STARTAMOUNT)
	ply:SetLevel( LEVEL_STARTAMOUNT )
	else
	ply:SetLevel( level )
	end
	
	if exp == nil then
	ply:SetPData("exp", EXP_STARTAMOUNT)
	ply:SetExp( EXP_STARTAMOUNT )
	else
	ply:SetExp( exp )
	end
	
	-----Cash
	if cash == nil then
	ply:SetPData("money", MONEY_STARTAMOUNT)
	ply:SetMoney( MONEY_STARTAMOUNT )
	else
	ply:SetMoney( cash )
	end
end

cl_init.lua
include( 'shared.lua' )
include( 'money_system.lua' )
include( 'level_system.lua' )
include( 'menu.lua' )
include( 'class.lua' )
include( 'radar.lua' )



function GM:HUDPaint()
	self.BaseClass:HUDPaint()
	local ply = LocalPlayer()
	
	if not ply:Alive() then return end
	if (ply:GetActiveWeapon() == NULL or ply:GetActiveWeapon() == "Camera") then return end
	
	local left = ply:GetActiveWeapon():Clip1()
	local extra = ply:GetAmmoCount(ply:GetActiveWeapon():GetPrimaryAmmoType()) 
	local sammo = ply:GetAmmoCount(ply:GetActiveWeapon():GetSecondaryAmmoType())
	local hp = ply:Health()
	local armor = ply:Armor()
	local skill1 = ply:GetSkills(1)
	local skill2 = ply:GetSkills(2)
	local skill3 = ply:GetSkills(3)
	local skill4 = ply:GetSkills(4)
	local level = ply:GetLevel()
	local money = ply:GetMoney()
	local expneeded = level*200*2
	local exp = ply:GetExp()
	local race = ply:GetRace(1)
	local name = ply:GetName()
	local clip1 = ply:GetActiveWeapon():Clip1()
	
	surface.CreateFont( "Font1",
                    {
                    font    = "Default",
                    size    = 20,
                    weight  = 800,
                    antialias = true,
                    shadow = false
    })
	
	surface.CreateFont( "Font2",
                    {
                    font    = "Default",
                    size    = 20,
                    weight  = 1,
                    antialias = true,
                    shadow = false
    })
	
	surface.CreateFont( "Font3",
                    {
                    font    = "Default",
                    size    = 16,
                    weight  = 2000,
                    antialias = true,
                    shadow = false
    })
	
	if hp > 180 then
		HpBarLength = 180
	else
		HpBarLength = hp
	end
	
	if armor > 180 then
		ArmorBarLength = 180
	else
		ArmorBarLength = armor
	end
	
	
	draw.RoundedBox(0, 10, ScrH()-160, 200, 150, Color(0,150,255,150))
	surface.SetDrawColor(Color(255,255,255, 255))
	surface.DrawLine(10, ScrH()-190, 210, ScrH()-190)
	
	draw.RoundedBox(0, 10, 10, 200, 150, Color(0,150,255,150))
	surface.SetDrawColor(Color(0,0,255, 200))
	surface.DrawLine(10, 10, 10, 160)
	surface.DrawLine(210, 10, 210, 160)
	
	draw.RoundedBox(0, 20, ScrH()-150, HpBarLength, 20, Color(0,255,50,200))
	draw.RoundedBox(0, 20, ScrH()-140, HpBarLength, 10, Color(20,20,20,30))
	
	draw.RoundedBox(0, 20, ScrH()-120, HpBarLength, 20, Color(0,50,255,200))
	draw.RoundedBox(0, 20, ScrH()-110, HpBarLength, 10, Color(20,20,20,30))
	
	surface.SetDrawColor(Color(255,255,255, 255))
	surface.DrawLine(10, ScrH()-160, 210, ScrH()-160)
	surface.SetFont("Font3")
	surface.SetTextColor(255,255,255,255)
	surface.SetTextPos(80, ScrH()-147)
	surface.DrawText( "HP: "..hp )
	
	surface.SetTextPos(74, ScrH()-118)
	surface.DrawText( "SHIELD: "..armor )
	
	draw.RoundedBox(0, 10, ScrH()-189, 201, 29, Color(0,200,255, 200))
	surface.SetTextPos(65, ScrH()-182)
	surface.DrawText( "EXP: "..exp.." / "..expneeded )
	
	surface.SetTextPos(220, ScrH()-25)
	surface.DrawText( "CLASS: ")
	
	surface.SetTextColor(30,80,110,255)
	surface.SetTextPos(271, ScrH()-25)
	surface.DrawText( race )
	
	surface.SetTextColor(255,255,255,255)
	surface.SetTextPos(220, ScrH()-45)
	surface.DrawText( "MONEY: " )
	
	surface.SetTextColor(255,200,0,255)
	surface.SetTextPos(271, ScrH()-45)
	surface.DrawText( money.." $" )
	
	surface.SetTextColor(255,255,255,255)
	surface.SetTextPos(220, ScrH()-65)
	surface.DrawText( "LEVEL: " )
	
	surface.SetTextColor(255,200,0,255)
	surface.SetTextPos(271, ScrH()-65)
	surface.DrawText( level )
	
	surface.SetTextColor(0,255,100,255)
	surface.SetTextPos(20, ScrH()-85)
	surface.DrawText( name )
	
	surface.SetTextColor(0,255,100,255)
	surface.SetTextPos(20, ScrH()-65)
	surface.DrawText( ply:Team() )
	
	surface.SetTextColor(255,255,255,255)
	surface.SetTextPos(20, ScrH()-45)
	surface.SetFont("Font1")
	surface.DrawText( "AMMO: "..left.." / "..extra )
	
	surface.SetDrawColor(Color(0,0,255, 200))
	surface.DrawLine(210, ScrH()-190, 210, ScrH()-10)
	surface.DrawLine(10, ScrH()-10, 10, ScrH()-190)
end
hook.Add("HUDPaint", "Name", ClassInfo)

local function MyMenu()

	ClassMenu()

end
usermessage.Hook("MyMenu", MyMenu)

local tohide = { 
	["CHudHealth"] = true,
	["CHudBattery"] = true,
	["CHudAmmo"] = true,
	["CHudSecondaryAmmo"] = true
}
local function HUDShouldDraw(name) 
	if (tohide[name]) then     
		return false;      
	end
end
hook.Add("HUDShouldDraw", "How to: HUD Example HUD hider", HUDShouldDraw)

Please help, don't ignore!



(User was banned for this post ("wrong section" - postal))