All pastes #590790 Raw Edit

Unnamed

public lua v1 · immutable
#590790 ·published 2007-06-26 19:43 UTC
rendered paste body
-- Serverfunction SendIDs( ToPlayer )	umsg.Start( "PlayerIDs", RecipientFilter( ):AddPlayer( ToPlayer ) ) -- First we start the umsg.  The first argument is the name, the second is the filter (See Recipient Filter)  			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 )