I used to implement such plugins a while ago.
All you need is to hook chat messages, block them, form new messages with prepended weapon type and send it further:
public Action OnClientSayCommand(int client, const char command, const char sArgs)
if(sArgs != '!')
int len = strlen(sArgs);
decl String:newcmd = "say123";
FakeClientCommand(client, newcmd); //that's only an idea
return Plugin_Handled; // here you block original command
Get client weapon:
If you want it to be shown only once, you can hook the most relevant event and iterate through all alive players via for loop in it.
to hook an event: https://sm.alliedmods.net/new-api/events/HookEvent
a list of events: https://wiki.alliedmods.net/Game_Events_(Source)