Add Participants to Event using functions

Add Participants to Event using functions

Please, I want add participants to an event using functions. ¿How? 
Thank you.