I’d recommend rewriting PlayerSelectSpawn to do what you want.
[lua]function GM:PlayerSelectSpawn( Player )[/lua]
Basically, you need to return a Point entity ( info_mobile_spawn or whatever you want to call it, but it needs to exist in your entities folder ) with the position and angles set, this is where the player would spawn. In the same function above, you’d essentially find the entity, if it doesn’t exist create it.
Then go through a list of spawns on the map and pick one randomly if it meets a few conditions ( A player can’t be standing there for example ). An easy way is to create a sub-helper function where it will build a list of possible spawns, then return a random one. By building a list of spawns ( Not the most optimal way to do things ) I mean you’re going through the list of spawns on the map, ensuring they meet the conditions and then adding them to a list; that will be your possible spawn locations list.
Then, you’d return a random table value. Both of the examples below do the exact same thing.
[lua]return possibleLocations[ math.random( 1, table.Count( possibleLocations ) ) ];
return table.Random( possibleLocations );[/lua]
Now, if you choose not to change the PlayerSelectSpawn function ( which does everything behind the scenes when you call Player:Spawn( ) ) and want to just set the player to a random spot in a less elegant solution, you’d basically do the same thing, except you wouldn’t locate or return the info_mobile_spawn Point entity, but you’d call Player:SetPos( spawnPosition ) and Player:SetEyeAngles( spawnAngle ) when you’ve found a random location.