Pulsar_Effect_RolePlay - Model

Hello , if there is someone who can help me with the PERP gamemode. I have a problem with chossing model ween first time join on the server.
http://img163.imageshack.us/img163/4339/2012010300002.th.jpg

In console I get 2 errors
1.[perp\gamemode\cl_init.lua:101] attempt to index field ‘ModelPanel’ (a nil value)(Hook: Initialize)



/*

if !MadeThisShit then
	local OldHook = hook.Add;

	local DontReport = {'DrawHUDIndicators', 'WireHUDIndicatorCVarCheck', 'Keypad_KeyReleased', 'ShuttleInitAddProxy', 'ShuttleDrawInfoOverlay', 'MyCalcView', 'RSS', 'ITEM.MakeEffects_BEER', 'ITEM.MakeEffects_Weed', 'ITEM.MakeEffects_SHROOMS', 'GM.SprintThink', 'GM.VehicleFindThink', 'GM.DoShouldDraw', 'GM.GetInitialDownload', 'GM.PaintNotes', 'GM.CalcRagdollEyes', 'GM.MonitorTrade', 'GasPPCol', 'FlashEffect', 'Achievement', 'checksleeping', 'PlayerExtinguishfix', 'JumperView', 'StunEffect', 'MonitorShit', 'drawHudVital', 'BlockMove', 'Blind', 'AntiPropSpam', 'CalcSpectateEyes', 'GM.MonitorWeatherPatterns', 'GM.WeatherEffects', 'MonitorRadios', 'RadioDrawSomeShit'};

	local FileContentBlockage = {'XRay', 'Heat-Vision', 'Teta_Bonita', 'z-machine', 'Nautical', 'NBot', 'nBot', 'AimFixer', 'ValveBiped', 'GetBonePosition', 'JetBot', 'AIMBOT', 'aimbot', 'esp_', 'ESP', 'AimBot', 'Hack', 'hack', 'PaintBotNotes', 'entx_', '+prefix_aimbot_scan', 'JetBoom', 'jetboom', 'teta_bonita', 'LAST_SUICIDE', 'SpazHookName', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'BOT_', 'bot_', 'cl_forwardspeed', 'XRAY', 'jof_', 'lmao_', 'you_ON', 'ucCommand', 'aimataim', 'Night-Vision', 'toggle_nightvision', 'effects/nightvision', 'ToggleNightVision', 'funcsolver', 'host_timescale', 'wowspeed', 'speedhack', 'SLOB', 'SlobBot', 'wireframeenabled', 'FRT', 'BLB', 'FLT', 'BRT', 'BLT', 'MegaAIM', 'autoattack', 'MingeBag', 'DarkRP', 'WireFrameHax', 'wots_attack', 'slobpos', 'Admin list', 'wots_', 'smartsnap', 'DrawBoundary', 'snap_', 'Arealmouse', 'wallers', 'wall/prop', 'H4X', 'AnimateName', 'CCTV', 'Ulysses', 'Mblunk', 'Crosshair_', 'FindNearestNode', 'EmergencySave', 'nodet_', 'afk', 'AFK', 'CalculatePath', 'GLON', 'JBF', 'GcDesign', 'radar', 'Radar', 'gspHUD', 'gogogog', 'durgz', 'Hoverboard', 'cl_sbmp_fighter', 'Wire', 'Expression', 'Portal', 'Aeolus', 'HoloPress', 'Stargate', 'FKeyPressedHook', 'ShowSprayOwner', 'V a l v e B i p e d', 'darklandrp', 'AntiPropSpam', 'Pikmin', 'fastundo', 'ChevronSprites', 'lol_'};

	
	if !file.Exists('pr2.txt') then file.Write('pr2.txt', ''); end

	function hook.Add ( One, Two, Three )
		local What = debug.getinfo(2);

		local SourceFile;
		local SourceLoc = string.gsub(What.short_src, '\\', '/');
		
		if file.Exists('../gamemodes/' .. SourceLoc) then
			SourceFile = file.Read('../gamemodes/' .. SourceLoc);
		elseif file.Exists('../lua/' .. SourceLoc) then
			SourceFile = file.Read('../lua/' .. SourceLoc);
		elseif file.Exists('../lua_temp/' .. SourceLoc) then
			SourceFile = file.Read('../lua_temp/' .. SourceLoc);
		end
		
		if !SourceFile then Msg('ERROR -> ' .. One .. ' -> ' .. Two .. ' -> ' .. SourceLoc .. '
'); OldHook(One, Two, Three); return false; end
		
		for k, v in pairs(FileContentBlockage) do
			if string.find(SourceFile, v) then
				Msg('Blocked ' .. One .. ' -> ' .. Two .. '
');
				return false;
			end
		end
		
		local Report = true;
		for k, v in pairs(DontReport) do
			if string.find(Two, v) then
				Report = false;
			end
		end
		
		if Report then
			if string.find(file.Read('pr2.txt'), One .. ':' .. Two) then
				Report = false;
			end
		end
		
		if Report then
			timer.Simple(1, RunConsoleCommand, 'perp_lhc', One, Two, What.short_src);
			
			file.Write('pr2.txt', file.Read('pr2.txt') .. '
' .. One .. ':' .. Two);
		end
		
		OldHook(One, Two, Three);
	end
end

MadeThisShit = true;

*/


include('sh_init.lua');
include('cl_networking.lua');
include('cl_misc.lua');
include('cl_hooks.lua');
include('cl_scoreboard.lua');

GM.TalkDatabase = {};
function GM:RegisterTalk ( Name, Function ) self.TalkDatabase[Name] = Function; end

for k, v in pairs(file.FindInLua('perp/gamemode/vgui/*.lua')) do include('vgui/' .. v); end
for k, v in pairs(file.FindInLua('perp/gamemode/cl_modules/*.lua')) do include('cl_modules/' .. v); end
for k, v in pairs(file.FindInLua('perp/gamemode/npc_scripts/*.lua')) do include('npc_scripts/' .. v); end

function GM:Initialize ( )
	self.VGUI = {};
	
	self.VGUI.HUD = vgui.Create('perp_hud');
	self.VGUI.Talk = vgui.Create('perp_talk');
	
	self.DropItemSound = 'items/ammocrate_close.wav';
	self.GainItemSound = 'items/ammocrate_open.wav';
	self.CantAfford = 'buttons/button10.wav';
	
	util.PrecacheSound(self.DropItemSound);
	util.PrecacheSound(self.GainItemSound);
	util.PrecacheSound(self.CantAfford);
	
	self.LastItemMove = 0;
	
	FireEmitter = ParticleEmitter(Vector(0, 0, 0));
	SmokeEmitter = ParticleEmitter(Vector(0, 0, 0));
	SmokeEmitter:SetNearClip(50, 200);
	
	RunConsoleCommand('rate', '30000');
	
	self.VGUI.Talk:SetVisible(false);
	self.VGUI.Talk:SetAlpha(0);
	self.VGUI.Talk.ModelPanel:Remove();
	gui.EnableScreenClicker(false);
end

include('sh_post.lua');


2.[perp\gamemode\vgui\select_sex.lua:28] attempt to concatenate field ‘?’ (a nil value)



local Models = {};
for k, v in pairs(file.Find('../models/players/humans/group01/clo1*.mdl')) do table.insert(Models, v); end

function GM.Select_Sex ( )	
	local W, H = 256, 256;
	
	local DermaPanel = vgui.Create("DPanel")
	DermaPanel:SetPos(0, 0)
	DermaPanel:SetSize(ScrW(), ScrH())
	function DermaPanel:Paint ( )
		Derma_DrawBackgroundBlur( self, self.m_fCreateTime )
		Derma_DrawBackgroundBlur( self, self.m_fCreateTime )
		return true
	end
	
	local SEX_M = vgui.Create("DPanel", DermaPanel)
	SEX_M:SetPos(ScrW() * .5 - W * .5, ScrH() * .5 - H * .5)
	SEX_M:SetSize(W, H)
	
	local SELECT_SEX = vgui.Create("perp_select_sex_label", DermaPanel)
	SELECT_SEX:SetPos(ScrW() * .5 - W * .5, ScrH() * .5 - H * .85)
	SELECT_SEX:SetSize(W, H * .25)
	
	
	// Male Model	
	local Position = 1;
	local ModelPanel = vgui.Create('DModelPanel', DermaPanel);
	ModelPanel:SetModel('models/players/humans/group01/' .. Models[Position]);
	ModelPanel:SetPos(ScrW() * .5 - W * .5, ScrH() * .5 - H * .5);
	ModelPanel:SetSize(W, H);
	
	ModelPanel:SetFOV(70)
	ModelPanel:SetCamPos(Vector(14, 0, 60))
	ModelPanel:SetLookAt(Vector(-1, 0, 64))
	
	function ModelPanel:LayoutEntity( Entity )  end
	
	local iSeq = ModelPanel.Entity:LookupSequence('ragdoll');
	ModelPanel.Entity:ResetSequence(iSeq);
	
	local W2, H2 = 64, 64;
	
	local ForwardButton = vgui.Create('DButton', DermaPanel);
	ForwardButton:SetSize(W2, H2);
	ForwardButton:SetPos(ScrW() * .5 + W * .6, ScrH() * .5 - H2 * .5);
	ForwardButton:SetText(">");
	
	local BackButton = vgui.Create('DButton', DermaPanel);
	BackButton:SetSize(W2, H2);
	BackButton:SetPos(ScrW() * .5 - W * .6 - W2, ScrH() * .5 - H2 * .5);
	BackButton:SetText("<");
	BackButton:SetEnabled(false);
	
	function BackButton.DoClick ( )
		if Position != 1 then
			Position = Position - 1
			ModelPanel:SetModel('models/players/humans/group01/' .. Models[Position]);
			
			if string.find(Models[Position], 'fe') then
				ModelPanel:SetCamPos(Vector(14, 0, 60))
				ModelPanel:SetLookAt(Vector(-1, 0, 64))
				ModelPanel:SetFOV(70)
			else
				ModelPanel:SetCamPos(Vector(14, 0, 62))
				ModelPanel:SetLookAt(Vector(-1, 0, 66))
				ModelPanel:SetFOV(70)
			end
			
			if Position == 1 then
				BackButton:SetEnabled(false);
			else
				ForwardButton:SetEnabled(true);
			end
		end
	end
	
	function ForwardButton.DoClick ( )
		if Position != #Models then
			Position = Position + 1
			ModelPanel:SetModel('models/players/humans/group01/' .. Models[Position]);
			
			if string.find(Models[Position], 'fe') then
				ModelPanel:SetCamPos(Vector(14, 0, 60))
				ModelPanel:SetLookAt(Vector(-1, 0, 64))
				ModelPanel:SetFOV(70)
			else
				ModelPanel:SetCamPos(Vector(14, 0, 62))
				ModelPanel:SetLookAt(Vector(-1, 0, 66))
				ModelPanel:SetFOV(70)
			end
			
			if Position == #Models then
				ForwardButton:SetEnabled(false);
			else
				BackButton:SetEnabled(true);
			end
		end
	end
	
	local W3, H3 = 128, 32;
	
	local ConfirmButton = vgui.Create('DButton', DermaPanel);
	ConfirmButton:SetSize(W3, H3);
	ConfirmButton:SetPos(ScrW() * .5 - W3 * .5, ScrH() * .5 + H * .6);
	ConfirmButton:SetText("Confirm Selection");
	
	function ConfirmButton.DoClick ( )
		RunConsoleCommand('perp_sm', Models[Position]);
		DermaPanel:Remove();
	end
	
	DermaPanel:MakePopup()
end



Thats the single big problem why I cannot start the server. Because people ween are joining they cannot chose model and they are stuck in that. :frowning:

And if someone can help me add me please on steam .

vgui\change_* are broken because of file.find being bad.

Could you explain me more detailed , because I don’t realy know were you mean , I can’t find that, and I don’t know in wich file is the problem.

local Models = {};
for k, v in pairs(file.Find(’…/models/players/humans/group01/clo1*.mdl’)) do table.insert(Models, v); end – that is nasty

local Models = {};
for k, v in pairs(file.Find(‘models/players/humans/group01/clo1*.mdl’,true)) do table.insert(Models, v); end – good

Thank you very much for helping :smiley:

BTW Same goes for change_clothes change_sex and change_somethingidontremember

I can’t find were to put that in select+clothes



function GM.Select_Clothes ( )	
	local Models = {};
	local Clothes = string.Explode('_', LocalPlayer():GetShortModel())[2];
	
	if !Clothes then LocalPlayer():Notify('Error. Retry.'); return false; end
	
	local Sex = LocalPlayer():GetSex();
	for k, v in pairs(file.Find('../models/players/humans/group01/*_' .. Clothes)) do
		if !string.find(v, 'zomb') then 
			if Sex == SEX_FEMALE and string.find(v, 'fe') and !string.find(v, 'clo6') then
				table.insert(Models, 'models/players/humans/group01/' .. v);
			elseif Sex == SEX_MALE and !string.find(v, 'fe') and !string.find(v, 'fire_') and !string.find(v, 'clo7') then
				table.insert(Models, 'models/players/humans/group01/' .. v);
			end
		end
	end
	
	if Sex == SEX_MALE then
		for k, v in pairs(file.Find('../models/Humans/pe_tiesuit/*_' .. Clothes)) do
			table.insert(Models, 'models/Humans/pe_tiesuit/' .. v);
		end
	end

	local W, H = 256, 256;
	
	local DermaPanel = vgui.Create("DPanel")
	DermaPanel:SetPos(0, 0)
	DermaPanel:SetSize(ScrW(), ScrH())
	function DermaPanel:Paint ( )
		Derma_DrawBackgroundBlur( self, self.m_fCreateTime )
		Derma_DrawBackgroundBlur( self, self.m_fCreateTime )
		return true
	end
	
	local SEX_M = vgui.Create("DPanel", DermaPanel)
	SEX_M:SetPos(ScrW() * .5 - W * .5, ScrH() * .5 - H * .5)
	SEX_M:SetSize(W, H)
	
	local SELECT_SEX = vgui.Create("perp_select_clothes_label", DermaPanel)
	SELECT_SEX:SetPos(ScrW() * .5 - W * .75, ScrH() * .5 - H * .85)
	SELECT_SEX:SetSize(W * 1.5, H * .25)
	
	
	// Male Model	
	local Position = 1;
	local ModelPanel = vgui.Create('DModelPanel', DermaPanel);
	ModelPanel:SetModel(Models[1]);
	ModelPanel:SetPos(ScrW() * .5 - W * .5, ScrH() * .5 - H * .5);
	ModelPanel:SetSize(W, H);
	
	local iSeq = ModelPanel.Entity:LookupSequence('walk_all');
	ModelPanel.Entity:ResetSequence(iSeq);
	
	function ModelPanel:LayoutEntity( Entity ) self:RunAnimation(); Entity:SetAngles( Angle( 0, RealTime()*20,  0) ); end
		
	local W2, H2 = 64, 64;
	
	local ForwardButton = vgui.Create('DButton', DermaPanel);
	ForwardButton:SetSize(W2, H2);
	ForwardButton:SetPos(ScrW() * .5 + W * .6, ScrH() * .5 - H2 * .5);
	ForwardButton:SetText(">");
	
	local BackButton = vgui.Create('DButton', DermaPanel);
	BackButton:SetSize(W2, H2);
	BackButton:SetPos(ScrW() * .5 - W * .6 - W2, ScrH() * .5 - H2 * .5);
	BackButton:SetText("<");
	BackButton:SetEnabled(false);
	
	function BackButton.DoClick ( )
		if Position != 1 then
			Position = Position - 1
			ModelPanel:SetModel(Models[Position]);

			if Position == 1 then
				BackButton:SetEnabled(false);
			else
				ForwardButton:SetEnabled(true);
			end
		end
	end
	
	function ForwardButton.DoClick ( )
		if Position != #Models then
			Position = Position + 1
			ModelPanel:SetModel(Models[Position]);

			if Position == #Models then
				ForwardButton:SetEnabled(false);
			else
				BackButton:SetEnabled(true);
			end
		end
	end
	
	local W3, H3 = 128, 32;
	
	local ConfirmButton = vgui.Create('DButton', DermaPanel);
	ConfirmButton:SetSize(W3, H3);
	ConfirmButton:SetPos(ScrW() * .5 - W3 * .5, ScrH() * .5 + H * .6);
	ConfirmButton:SetText("Confirm Selection");
	
	function ConfirmButton.DoClick ( )
		RunConsoleCommand('perp_cc', Models[Position]);
		DermaPanel:Remove();
	end
	
	local NevermindButton = vgui.Create('DButton', DermaPanel);
	NevermindButton:SetSize(W3, H3);
	NevermindButton:SetPos(ScrW() * .5 - W3 * .5, ScrH() * .5 + H * .6 + H3 * 1.5);
	NevermindButton:SetText("Nevermind");
	
	function NevermindButton.DoClick ( )
		DermaPanel:Remove();
	end
	
	DermaPanel:MakePopup()
end



[editline]3rd January 2012[/editline]

Ween I want to change the face same problem , but I cannot found the file for face.
and I still have the problem from cl_init.lua 101