Ulysses
General => Developers Corner => Topic started by: Mindless on February 07, 2013, 07:44:21 PM
-
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 )
-
Yeah, I'm looking at it right now. I don't know too much about user messages, but I know enough to get around. So give me about five minutes, and I hope I can fix this thing for you :)
-
Yeah, because I did "too much" to the code, I'll just send you them, because making a code tag[] for "all these", would just be a waste of time.. so here you go sir
https://mega.co.nz/#!zRUVhK6b!MYGYQiP_drZZPF62ZXr-7j7QF8sw1jtbEbKIOyafG3k
-
Yeah, because I did "too much" to the code, I'll just send you them, because making a code tag[] for "all these", would just be a waste of time.. so here you go sir
https://mega.co.nz/#!zRUVhK6b!MYGYQiP_drZZPF62ZXr-7j7QF8sw1jtbEbKIOyafG3k
It crashes my server when people type: !join - otherwise it works perfect.
-
Did you make sure to delete your old script?
-
Did you make sure to delete your old script?
Yeah.
-
well I don't see anything wrong with it, but I did change a few things. So here you go..
https://mega.co.nz/#!yJkjnCrb!Y_H0KUTETOshbXUEmDQFOl37jmZf_xSOW83vxtF5bWM
remember, put this in lua/autorun