Is there a way to limit max credit number or coins inserted on mame?
Solution 1:
And it will not be that fun if putting credits is an unlimited action.
I had the same problem with my RetroPie cabinet. To solve this I devised a joystick system with an integrated credit counter. The system disables the insert coin buttons unless credits are available and includes a little challenge that must be won in order to obtain them. The challenge is the Simon Says electronic game created by Ralph Baer and Howard J. Morrison in 1978. As in the original Simon game there are several skill levels. The number of credits obtained when the game is won will depend on the selected skill level. You can see the project at hackster.io and github.com. You can also see a video demo at youtu.be.
Solution 2:
No such feature exists, though I guess a skilled programmer could add something like that to the MAME source code. Since the purpose of MAME is to preserve the games in their original state, I doubt such a feature will ever be added to the official MAME release.