AddTransferFile("sfx/starkkz/welcome.wav")

addhook("join","welcome_message")
function welcome_message(id)
	if SERVER_DATA["wmsg_active"] then
		msgc2(id, "Welcome to my server, "..player(id,"name").."!", 0, 255, 0)
		parse("sv_sound2 "..id.." starkkz/welcome.wav")
	end
end

function WMSGButton()
	if SERVER_DATA["wmsg_active"] then
		return "Welcome Message|Enabled"
	end
	return "Welcome Message|Disabled"
end

function WMSGToggle()
	if SERVER_DATA["wmsg_active"] then
		SERVER_DATA["wmsg_active"] = nil
	else
		SERVER_DATA["wmsg_active"] = true
	end
end
CreateSetting(WMSGButton,WMSGToggle)