Make player unable to pick up gun

In this script if a player RDMs it announces it, then forces the “weapon_mu_magnum” to drop and the player can’t pick it up for 500 seconds. That works great, but my problem is that if two or more people RDM then they can pick eachothers magnums up, just not their own. Would there be any way to make so they are restricted from using the magnum period, not just their own?

Announcing RDM and dropping weapon:



if attacker != ply then
				if self.ShowBystanderTKs:GetBool() then
					local ct = ChatText()
					local col = attacker:GetPlayerColor()
					ct:Add(attacker:Nick() .. ", " .. attacker:GetBystanderName(), Color(col.x * 255, col.y * 255, col.z * 255))
					ct:Add(" killed an innocent bystander")
					ct:SendAll()
				end
				attacker.LastTKTime = CurTime()
				attacker:CalculateSpeed()
				timer.Simple(0, function () 
					if IsValid(attacker) && attacker:HasWeapon("weapon_mu_magnum") then
						local wep = attacker:GetWeapon("weapon_mu_magnum")
						wep.LastTK = attacker
						wep.LastTKTime = CurTime()
						attacker:DropWeapon(wep)
					end
				end)
			end


Not being able to pick that weapon up after rdm for 500 seconds:



		if ent.LastTK == ply && ent.LastTKTime + 500 > CurTime() then
			return false
		end
	end


You could try making it so that checks the weapons class. So ent:GetClass(), etc.

Yes, just use this hook:
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index3789.html

and check if player is not allowed to pick magnum up, check if class is magnum, if yes, return false

Thanks

[editline]15th December 2013[/editline]

So something like this would work?


function GM:PlayerCanPickupWeapon(ply, wep)

if ent.LastTK == ply && ent.LastTKTime + 500 > CurTime() then
   if wep:GetClass() == "weapon_mu_magnum" then return false end
   return true
end

what is ent?
[lua]
if ( ent.LastTK == ply && ent.LastTKTime + 500 > CurTime() && wep:GetClass() == “weapon_mu_magnum” ) then
return false;
else
return true;
end[/lua]

Not too sure, It’s part of the script that makes the player wait 500 seconds before picking up the magnum again.

I’m editing the sv_player.lua from the murder gamemode.

I assume that ent is player, so try to change ent to ply like

if ( ply.LastTK && ply.LastTKTime + 500 > CurTime()