All pastes #590786 Raw Edit

Unnamed

public lua v1 · immutable
#590786 ·published 2007-06-26 19:41 UTC
rendered paste body
-- Serverfunction SendIDs( ToPlayer )	umsg.Start( "PlayerIDs", ToPlayer ) -- First we start the umsg.  The first argument is the name, the seocnd is the filter (player or nil for all)  			umsg.Short( #player.GetAll( ) ) -- Since we don't read it as a table, we need to know how many values we have.				for i, v in pairs( player.GetAll( ) ) do					umsg.String( v:UniqueID( ) ) -- Now we send our Steam IDs				end	 	umsg.End( ) -- Now we end our umsg.  It will now be streamed to the clientend-- Clientfunction ReadIDs( umsg )	local Count = umsg:ReadShort( ) -- This is the number of Steam IDs we set on line 6	local SteamIDs = { } -- We'll store the SteamIDs in here		for i = 1, Count do			SteamIDs[ i ] = umsg:ReadString( )		end		-- You're done.endusermessage.Hook( "PlayerIDs", ReadIDs )