You could use a boolean like structure.
you create a boolean variable set to false (or use 0 for false and 1 for true)
When the enemy sees the player and the boolean is false, shoot and set the boolean to true.
Then every x seconds, if the boolean is true shoot again.
if the enemy can't see the player anymore, set the boolean to false again.