Example #1
0
int lPhysVehicleGetWheelMaterial(lua_State *state) {
	IPhysicsVehicleController *pController = Get_PhysVehicleController(state, 1);
	LUA->CheckType(2, Type::NUMBER);

	IPhysicsObject *pWheel = pController->GetWheel(LUA->GetNumber(2));
	if (!pWheel)
		return 0;

	const char *mat = g_pSurfProps->GetPropName(pWheel->GetMaterialIndex());
	LUA->PushString(mat);
	return 1;
}