[Request] GetVehicleClass native server sided

Is that possible to have GetVehicleClass native also as server-sided native too I tried to achieve the same goal with state bags but it seems it doesn’t sync with the server

[CLIENT] It correctly return vehicle class at the end when I print it

RegisterNetEvent('vehicleSpawned')
AddEventHandler('vehicleSpawned', function(netid, applies)
    local vehicle = SetNetIDProperties(netid, applies)
    local veh = Entity(vehicle)
    veh.state:set("class", GetVehicleClass(vehicle), true)
    print(veh.state.class)
end)

[SERVER] But in server it returns null when I am sitting on exact same vehicle and gets the vehicle class with state bag

RegisterCommand("getcs", function(source)
	local ped = GetPlayerPed(source)
	local vehicle = GetVehiclePedIsIn(ped)
	local veh = Entity(vehicle)
	print(veh.state.class)
end)
1 Like