Why would it show online in WhatsApp? CarPlay enables a vehicle's infotainment system to be a display and a controller for an iOS device. You can read all about CarPlay via the CarPlay Wiki or via Apple's website.
Are you asking if your status will show as online in WhatsApp if you're using CarPlay? It should show you as online. All CarPlay does is displays some of your iPhone's content on the screen in your car. If you're showing as online in WhatsApp before connecting to CarPlay, then you should also be showing as online after connecting to CarPlay.
CarPlay shouldn’t affect your online status in WhatsApp. Only thing that would affect that would be your connection to a network whether it be cellular or WiFi