Getting coords and making portable checkpoint

How can I get coords for the checkpoint like a GTA online Terrorbyte or Avenger which will works only if veh speed < 20 mph? I don’t know how to get coords.

Like this

https://runtime.fivem.net/doc/natives/#_0x3FEF770D40960D5A
https://runtime.fivem.net/doc/natives/#_0xD5037BA82E12416F