public plugin_init() register_clcmd("buy", "buy"); public buy(id){ // Player pressed "buy" (usually M) // Your stuff here}