All pastes #542835 Raw Edit

Spawn weapon

public text v1 · immutable
·published 2007-06-05 23:00 UTC
rendered paste body
function GM:PlayerDeath( ply, weapon, killer )

	self.BaseClass:PlayerDeath( ply, weapon, killer );

	ply:GetTable().DeathPos = ply:GetPos();

	if( ply ~= killer or ply:GetTable().Slayed ) then
		
		local ent = ents.Create( currentWeapon:GetClass() );
		ent:SetPos( ply:GetTable().DeathPos );
		ent:Spawn();

		ply:GetTable().Arrested = false;
		ply:GetTable().DeathPos = nil;
		ply:GetTable().Slayed = false;
	
	end

end


function GM:Think()
	if ( ply:Alive() ) then
		ply.currentWeapon = ply:GetActiveWeapon()
	end
end