Random Model Generator

I’m making a random model generator that’s very basic. When a player spawns it does this.
[lua]ply:SetModel(“models/player/male_0” … math.random(1,9) … “.mdl”)[/lua]

Would this work?
Also (May seem noobish) but whats the command to spawn a player, and set his TEAM.
And is there any place where I can find all these commands?

http://wiki.garrysmod.com/?title=Player and http://wiki.garrysmod.com/?title=Entity.

Also, that model doesn’t exist. you want [lua]models/player/Group01/Male_0x.mdl[/lua]

So… if I put
[lua] ply:SetModel(“models/player/Group01/Male_0” … math.random(1,9) … “.mdl”) [/lua]
It will work?

-snip-

Yes, it should work.

Aww cool.

Ok thanks. One more question.
To spawn a player what command do I need. I can’t find it anywhere.

http://wiki.garrysmod.com/?title=Entity.Spawn also works for players.

Thanks. Well looks like that’s all I need for now.