@amirmehrvarz

I would really recommend to start with the tutorials, workshops and the manual.
Asking others to write your code will bring you nothing, cause the next problem will stop you again.
This forum has a lot of helpful people, especially Uhrwerk, he helped me a lot with my recent problems.
Think about an idea how this problem could be solved. Uhrwerks link is perfect for that. If you have problems then, post your code so we can look at it and help you to understand where the mistakes are. To ask without trying is imho cheeky.
Sorry for the long text.

Kind regards