Minecraft wiki entry for Command_blocks_and_functions, associated text: Players can easily give people a starter kit with a button without plugins: /give @p[distance=2]. To prevent people pressing the button a second time and again getting their kit, players can make two command blocks activated in order: /give @p[distance=2,m=2] minecraft:stone_pickaxe
/gamemode @p[distance=2] survival