Spawning carts

How can you ensure a cart can spawn on all the railways by command? I seem to be able to only spawn in certain areas.

Thank you for the good work :)

I have a check in my code that verifies if you are standing next to a railway... 

SjLTnIAX015qQH2.png Lincoln

I have a check in my code that verifies if you are standing next to a railway... 

Thank you for the reply, I explained badly. Sometimes even when standing near/on/around the longest straight tracks (36') the cart sometimes announces it has spawned but nothing is there, and then you are able to try spawning again.

I have a friend who has done some changes to the code, and I wanted to add a delay so people can't spam the cart spawn after they are destroyed but not sure how to approach it because of the cart not 100% reliably spawning. I know nothing about coding and he is new to rust plugins and I guess was just wondering if you had any guidance to make it more reliable? Thank you for your time.