Better yet, just setup a ctrlr file. Copy the code below to a file gun.cfg and put it in your ctrlr\ directory. Change the settings to match your configuration. On mine the mouse is 1, then I have guns 2, 3, 4. You could set it up so that the Player 1, 2 are guns 2, 3 and player 3 is mouse, etc.
Then include this in the game's ini file:
ctrlr gun
ctrlr\gun.cfg:
<mameconfig version="10">
<system name="default">
<!-- My Gun Version 1.0 input configuration file -->
<input>
<port type="COIN1">
<newseq type="standard">
KEYCODE_5 OR GUNCODE_2_BUTTON4
</newseq>
</port>
<port type="COIN2">
<newseq type="standard">
KEYCODE_6 OR GUNCODE_3_BUTTON4
</newseq>
</port>
<port type="COIN3">
<newseq type="standard">
KEYCODE_7 OR GUNCODE_4_BUTTON4
</newseq>
</port>
<port type="START1">
<newseq type="standard">
KEYCODE_1 OR GUNCODE_2_BUTTON5
</newseq>
</port>
<port type="START2">
<newseq type="standard">
KEYCODE_2 OR GUNCODE_3_BUTTON5
</newseq>
</port>
<port type="START3">
<newseq type="standard">
KEYCODE_3 OR GUNCODE_4_BUTTON5
</newseq>
</port>
<port type="P1_BUTTON1">
<newseq type="standard">
GUNCODE_2_BUTTON1
</newseq>
</port>
<port type="P2_BUTTON1">
<newseq type="standard">
GUNCODE_3_BUTTON1
</newseq>
</port>
<port type="P3_BUTTON1">
<newseq type="standard">
GUNCODE_4_BUTTON1
</newseq>
</port>
<port type="P1_BUTTON2">
<newseq type="standard">
GUNCODE_2_BUTTON3
</newseq>
</port>
<port type="P2_BUTTON2">
<newseq type="standard">
GUNCODE_3_BUTTON3
</newseq>
</port>
<port type="P3_BUTTON2">
<newseq type="standard">
GUNCODE_4_BUTTON3
</newseq>
</port>
<port type="P1_LIGHTGUN_X">
<newseq type="standard">
GUNCODE_2_XAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P1_LIGHTGUN_Y">
<newseq type="standard">
GUNCODE_2_YAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P2_LIGHTGUN_X">
<newseq type="standard">
GUNCODE_3_XAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P2_LIGHTGUN_Y">
<newseq type="standard">
GUNCODE_3_YAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P3_LIGHTGUN_X">
<newseq type="standard">
GUNCODE_4_XAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P3_LIGHTGUN_Y">
<newseq type="standard">
GUNCODE_4_YAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P1_AD_STICK_X">
<newseq type="standard">
GUNCODE_2_XAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P1_AD_STICK_Y">
<newseq type="standard">
GUNCODE_2_YAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P2_AD_STICK_X">
<newseq type="standard">
GUNCODE_3_XAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P2_AD_STICK_Y">
<newseq type="standard">
GUNCODE_3_YAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P3_AD_STICK_X">
<newseq type="standard">
GUNCODE_4_XAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P3_AD_STICK_Y">
<newseq type="standard">
GUNCODE_4_YAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
</input>
</system>
</mameconfig>