Car stats- View car statistics with a simple command



I decided I’d do a bit of lua work so I coded up a simple command that sends stats about the car/vehicle you’re in to your chat.
Feedback is welcome and encouraged.


  • Name (not spawn name) of the car
  • Max speed in MPH
  • Acceleration rate
  • Number of gears
  • Capacity

Enjoy, everyone!
Usage: /carstats when you’re in a vehicle (1.0 KB)


This is actually pretty cool! Nice release. :slight_smile:


Very unique…



yes this is very unique and pretty neat! I will definitely put this in my upcoming community! This is useful info! Thanks Setro!


how to convert max speed to KMH?


If you can code just a litle you will find out very easy :wink:


This looks very cool, definitely going to suggest this to my community. Let us know if you update it with more content!


Do you know that you are not able to get real maxspeed and gears?


What do you mean I’m not able to get the real max speed and gears? These are the natives for the vehicle, they’re not fake.


Sure. Replace the contents of the server.lua with this:

AddEventHandler('carstats', function()
local ped = PlayerPedId()
	if IsPedInAnyVehicle(ped, false) then
		local veh = GetVehiclePedIsIn(ped, false)
		local model = GetEntityModel(veh, false)
		local hash = GetHashKey(model)
		TriggerEvent('chatMessage', "", {255, 0, 0}, "^3Name (not spawn name):^7 ".. GetDisplayNameFromVehicleModel(model))
		TriggerEvent('chatMessage', "", {255, 0, 0}, "^3Max speed (MPH):^7 ".. round(GetVehicleMaxSpeed(model) * 3.6,1))
		TriggerEvent('chatMessage', "", {255, 0, 0}, "^3Acceleration rate:^7 ".. round(GetVehicleModelAcceleration(model),1))
		TriggerEvent('chatMessage', "", {255, 0, 0}, "^3Number of gears:^7 ".. GetVehicleHighGear(veh))
		TriggerEvent('chatMessage', "", {255, 0, 0}, "^3Capacity:^7 ".. GetVehicleMaxNumberOfPassengers(veh) + 1)

--snippet borrowed from
function round(num, numDecimalPlaces)
  local mult = 100^(numDecimalPlaces or 0)
  return math.floor(num * mult + 0.5) / mult

I’m coding it based off of what the numbers I found on sources say. If it seems off let me know and I’ll look further.


I don’t see a way to find that info out, sorry.


Thanks man!
Awesome Script!


its all good


Great release!

Maybe in the future try adding the spawn name that way we can blacklist the vehicles we don’t know the spawn names too and are too lazy to look it up… lol…

Anyways, Great job!