Well basically i've scripted this thing with my friend but it doesn't work. It's currently in lua/autorun/server/join.lua - If anyone can tell me the error please it would very appericated!
--[[
This makes it so that it shows players disconnecting and connecting. Aswell it allows people to type !join to join the group.
--]]
function fPlayerDisconnect( ply )
for k, v in pairs (player.GetAll()) do
umsg.Start("disconnect", v)
umsg.String(ply:Name())
umsg.String(tostring(ply:SteamID()))
umsg.End()
end
end
hook.Add( "PlayerDisconnected", "playerdisconnected", fPlayerDisconnect )
function fPlayerConnect( ply )
for k, v in pairs (player.GetAll()) do
umsg.Start("connect", v)
umsg.String(ply:Name())
umsg.String(tostring(ply:SteamID()))
umsg.End()
end
end
hook.Add( "PlayerConnected", "playerconnected", fPlayerConnect )
usermessage.Hook("connect", function(um)
chat.AddText(Color(158, 195, 79), um:ReadString().." has connected. (ID: "..um:ReadString()..")")
end)
usermessage.Hook("disconnect", function(um)
chat.AddText(Color(158, 195, 79), um:ReadString().." has left the server. (ID: "..um:ReadString()..")")
end)
function JoinCommand( pl, text, teamonly )
if (text == "!join") then
pl:SendLua([[gui.OpenURL("http://steamcommunity.com/groups/SourceGamin)]]) -- Change ADDRESS to your chosen page.
for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has joined our Steam group via !join." )
end
end
end
hook.Add( "PlayerSay", "Chat", JoinCommand )