std :: thread ( [ & ] { while ( ! isSampAvailable ( ) ) { } sampRegisterChatCommand ( "slap" , CMDPROC__SlapId ) ; } ) . detach ( ) ; } void CMDPROC__SlapId ( const char * ) { std :: string text_ ( "/slap id" ) ; }