I think he's asking for when a specific player type spawns though.
If you want it when any player spawns with any player type use what Kalphiter posted.
If you want it only when a player spawns with a certain datablock use Playertypename::onAdd(%db,%obj)