• Cant create entity!
    3 replies, posted
Hello im making a gamemode and have this issue: I have addons in the server, they were working before and now i just get this error, and they exist because the weapon pack even downloads on connection. [code] --// Include Files AddCSLuaFile( "shared.lua" ) AddCSLuaFile( "cl_init.lua" ) include( 'shared.lua' ) --//WEAPON LISTS--\\ --For valid weapon names go into addons - WEAPON PACK NAME - lua - weapons - Then all of the names for the weapons are there. --All that needs editing are the names of the weapons below, you are also welcome to add more lists WepList = --//LIST 1\\-- { 'tfa_luger', 'tfa_deagle', 'tfa_scoped_taurus', 'tfa_ragingbull', 'tfa_glock', 'tfa_colt1911', 'tfa_hk45', 'tfa_sig_p229r', 'tfa_mp5', 'tfa_bizonp19', 'tfa_kac_pdw', 'tfa_magpulpdr', 'tfa_mp5sd', 'tfa_honeybadger', 'tfa_mp9', 'tfa_bf4_ak5c', 'tfa_bf4_asval', 'tfa_bf4_aek971', 'tfa_bf4_ak12', 'tfa_vector', 'tfa_bf4_338', 'tfa_mp7', 'm9k_dragunov', 'm9k_intervention', 'm9k_m24', 'm9k_barret_m82', 'm9k_aw50', 'm9k_sl8', 'm9k_svt40', 'm9k_svu', 'm9k_spas12', 'm9k_usas', 'm9k_remington870', 'm9k_remington7615p', 'm9k_m249lmg', 'm9k_pkm', 'm9k_dbarrel', 'm9k_1887winchester', 'm9k_1897winchester', 'm9k_ares_shrike' }, --//LIST 2\\-- { 'tfa_luger', 'tfa_colt1911', 'tfa_glock', 'tfa_hk45', 'tfa_ragingbull', 'tfa_scoped_taurus', 'tfa_tec9', 'tfa_usp', 'tfa_usc', 'tfa_uzi', 'tfa_sig_p229r', 'tfa_model500', 'tfa_model627', 'tfa_model3russian', 'tfa_m29satan', 'tfa_m92beretta', 'tfa_bf4_aek971', 'tfa_bf4_ak12', 'tfa_bf4_ak5c', 'tfa_bf4_338', 'tfa_bf4_asval', 'm9k_spas12', 'm9k_usas', 'm9k_remington870', 'm9k_remington7615p', 'm9k_svu', 'm9k_psg1', 'm9k_dragunov', 'm9k_dbarrel', 'm9k_aw50', 'm9k_intervention', 'm9k_ithacam37', 'm9k_m24', 'm9k_m249lmg', 'm9k_m1918bar', 'm9k_mossberg590', 'm9k_pkm', 'm9k_striker12', 'm9k_m3' } --//Player spawn - Gives correct weapon on spawn function GM:PlayerSpawn( p2 ) level = p2:GetNWFloat('level', 1) --//Defines Level p2:SetNWFloat('level', level) --//Sets level WeaponList = WepList[math.random(1, #WepList)] self.BaseClass:PlayerSpawn( p2 ) p2:SetGravity( 1, 900 ) p2:SetMaxHealth( 100, true ) p2:SetWalkSpeed( 165 ) p2:SetRunSpeed( 355 ) end --// Disable 'Kill' Command local function BlockSuicide(p1) p1:ChatPrint("You Are Not Allowed To Use The Console Command 'Kill' It Causes The Player To No Longer Have A Weapon At Spawn.") return false end hook.Add( "CanPlayerSuicide", "BlockSuicide", BlockSuicide ) --//Set Model function GM:PlayerSetModel( ply ) ply:SetModel( "models/player/leet.mdl" ) end --//Player Kill And level Up function GM:PlayerDeath(victim, inflictor, attacker) if ( victim == attacker ) then PrintMessage(HUD_PRINTTALK, "=================================================") PrintMessage(HUD_PRINTTALK, attacker:Name() .. " Committed suicide!") PrintMessage(HUD_PRINTTALK, "=================================================") attacker:StripWeapon(WeaponList[level]) attacker:Give(WeaponList[level-1]) attacker:GiveAmmo(999, weapons.Get(WeaponList[level-1]).Primary.Ammo) attacker:SetNWFloat('level', attacker:GetNWFloat('level',1) -1) else PrintMessage(HUD_PRINTTALK, "=================================================") PrintMessage(HUD_PRINTTALK, attacker:Name() .. " Killed " .. victim:Name() .. "!") PrintMessage(HUD_PRINTTALK, "=================================================") attacker:StripWeapon(WeaponList[level]) attacker:Give(WeaponList[level+1]) attacker:GiveAmmo(999, weapons.Get(WeaponList[level+1]).Primary.Ammo) attacker:SetNWFloat('level', attacker:GetNWFloat('level',1) +1) end if (level == #WepList) then for k, v in pairs( player.GetAll() ) do v:StripWeapons() v:SetNWFloat('level', 1) v:Spawn() if (level == 1) then v:Give(WeaponList[level]) end return end end end --//Gives first weapon on first spawn function GM:PlayerLoadout(pl) if (level == 1) then pl:Give(WeaponList[level]) end end [/code] error: Attempted to create unknown entity type t! NUL Ent in GiveNamedItem!
That doesn't seem to be the code causing the problem since it doesn't create any entities. Do any of your files contain the words 'GiveNamedItem'? Try posting the orginal error.
That is the original error, but I can't understand why it's only an issue now because the only things I have been changing is the init file in my game mode.
I fixed it, it was because i put WeaponList where weplist should have been
Sorry, you need to Log In to post a reply to this thread.