I'll be perfectly honest, I have destroyed this code so horribly that the only way you could help is if I showed you the original.
The ZIP comes with 2 files, this is sv_player.lua
// server side apple
AddCSLuaFile( "cl_player.lua" )
//Spawn
function FirstSpawn( ply )
timer.Create( "server_spawn_timer_wait", 3, 1, function()
colour1 = ply:Team()
spawn1 = ply:Nick()
umsg.Start( "player_spawn")
umsg.String(spawn1)
umsg.Short(colour1)
umsg.End()
Msg("Player " .. spawn1 .. " has joined the server.\n")
end)
end
hook.Add( "PlayerInitialSpawn", "playerInitialSpawn", FirstSpawn )
//Disconnect
function PlayerDisconnect( ply )
colour3 = ply:Team()
spawn3 = ply:Nick()
umsg.Start( "player_disconnect")
umsg.String(spawn3)
umsg.Short(colour3)
umsg.End()
Msg("Player " .. spawn3 .. " has left the server.\n")
end
hook.Add( "PlayerDisconnected", "playerDisconnected", PlayerDisconnect )
This is cl_player.lua
// client side apple
// Spawn
function player_spawn( data )
local name1 = data:ReadString()
local nickteamcolour1 = team.GetColor(data:ReadShort())
chat.AddText( Color( 255, 0, 255 ), "[Server] ", nickteamcolour1, name1, Color( 255, 255, 255 ), " has joined in the server." )
surface.PlaySound( "garrysmod/save_load1.wav" )
end
usermessage.Hook("player_spawn", player_spawn)
// Disconnect
function player_disconnect( data )
local name3 = data:ReadString()
local nickteamcolour3 = team.GetColor(data:ReadShort())
chat.AddText( Color( 255, 0, 255 ), "[Server] ", nickteamcolour3, name3, Color( 255, 255, 255 ), " has left the server." )
surface.PlaySound( "garrysmod/save_load2.wav" )
end
usermessage.Hook("player_disconnect", player_disconnect)
Again, thanks for any help.