All pastes #389753 Raw Edit

Miscellany

public lua v1 · immutable
·published 2007-03-10 22:38 UTC
rendered paste body
function GM:PlayerBindPress( ply, bind )if bind == "stopsounds" then return true end  //we don't want them disabling sounds.if bind == "kill" and ply:Team() ~= 3 then return true end  //anyone on team 1 or 2 cannot use keys bound to "kill"if ply:Team() == 3 and bind == "impulse 100" then return true end	if ply:Team() == 1 and bind == "impulse 100" then			if ply:GetVar("visuals", "nothingomg") == "vis_laser" then			if ply:GetVar("togglevis", "off") == "off" then --turn it on							ply:SetVar("togglevis", "on")				return bind == "impulse 100" //disable flashlight						elseif ply:GetVar("togglevis", "off") == "on" then --turn it off							ply:SetVar("togglevis", "off")				return bind == "impulse 100" //disable flashlight							end				elseif ply:GetVar("visuals", "nothingomg") == "vis_flashlight" then				if ply:GetVar("togglevis", "off") == "off" then --turn it on							//ply:SetVar("togglevis", "on")				Msg("light on \n")				return bind ~= "impulse 100"					elseif ply:GetVar("togglevis", "off") == "on" then --turn it off											//ply:SetVar("togglevis", "off")				Msg("light off \n")				return bind == "impulse 100"					end					elseif ply:GetVar("visuals", "nothingomg") == "vis_heat" then				if ply:GetVar("togglevis", "off") == "off" then --turn it on							ply:EmitSound(Sound("buttons/button19.wav"))				ply:SetVar("togglevis", "on")				Msg("heat on \n")				return bind == "impulse 100"					elseif ply:GetVar("togglevis", "off") == "on" then --turn it off							ply:EmitSound(Sound("buttons/combine_button7.wav"))				ply:SetVar("togglevis", "off")				Msg("heat off \n")				return bind == "impulse 100"					end		end	elseif ply:Team() == 2 then			if ply:GetVar("togglevis", "off") == "off" then --turn it on				ply:SetVar("togglevis", "on")		return bind == "impulse 100"				else				ply:SetVar("togglevis", "off")		return bind == "impulse 100"				end	end		return bind end