I do not understand the meaning of "tinham pregado" in

I do not understand the meaning of “tinham pregado” in this lesson. Can you help?

“Pregar uma peça” neste caso significa “pregar uma partida” - play a trick