mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-18 14:26:03 +01:00
feat: add more info to veh props
This commit is contained in:
@@ -1,3 +1,190 @@
|
|||||||
|
local vehicleColorNames = {
|
||||||
|
[0] = "Black",
|
||||||
|
[1] = "Black",
|
||||||
|
[2] = "Black",
|
||||||
|
[3] = "Silver",
|
||||||
|
[4] = "Silver",
|
||||||
|
[5] = "Silver",
|
||||||
|
[6] = "Gray",
|
||||||
|
[7] = "Silver",
|
||||||
|
[8] = "Silver",
|
||||||
|
[9] = "Silver",
|
||||||
|
[10] = "Metal",
|
||||||
|
[11] = "Grey",
|
||||||
|
[12] = "Black",
|
||||||
|
[13] = "Gray",
|
||||||
|
[14] = "Grey",
|
||||||
|
[15] = "Black",
|
||||||
|
[16] = "Black",
|
||||||
|
[17] = "Silver",
|
||||||
|
[18] = "Silver",
|
||||||
|
[19] = "Metal",
|
||||||
|
[20] = "Silver",
|
||||||
|
[21] = "Black",
|
||||||
|
[22] = "Graphite",
|
||||||
|
[23] = "Silver",
|
||||||
|
[24] = "Silver",
|
||||||
|
[25] = "Silver",
|
||||||
|
[26] = "Silver",
|
||||||
|
[27] = "Red",
|
||||||
|
[28] = "Red",
|
||||||
|
[29] = "Red",
|
||||||
|
[30] = "Red",
|
||||||
|
[31] = "Red",
|
||||||
|
[32] = "Red",
|
||||||
|
[33] = "Red",
|
||||||
|
[34] = "Red",
|
||||||
|
[35] = "Red",
|
||||||
|
[36] = "Orange",
|
||||||
|
[37] = "Gold",
|
||||||
|
[38] = "Orange",
|
||||||
|
[39] = "Red",
|
||||||
|
[40] = "Red",
|
||||||
|
[41] = "Orange",
|
||||||
|
[42] = "Yellow",
|
||||||
|
[43] = "Red",
|
||||||
|
[44] = "Red",
|
||||||
|
[45] = "Red",
|
||||||
|
[46] = "Red",
|
||||||
|
[47] = "Red",
|
||||||
|
[48] = "Red",
|
||||||
|
[49] = "Green",
|
||||||
|
[50] = "Green",
|
||||||
|
[51] = "Green",
|
||||||
|
[52] = "Green",
|
||||||
|
[53] = "Green",
|
||||||
|
[54] = "Green",
|
||||||
|
[55] = "Green",
|
||||||
|
[56] = "Green",
|
||||||
|
[57] = "Green",
|
||||||
|
[58] = "Green",
|
||||||
|
[59] = "Green",
|
||||||
|
[60] = "Green",
|
||||||
|
[61] = "Blue",
|
||||||
|
[62] = "Blue",
|
||||||
|
[63] = "Blue",
|
||||||
|
[64] = "Blue",
|
||||||
|
[65] = "Blue",
|
||||||
|
[66] = "Blue",
|
||||||
|
[67] = "Blue",
|
||||||
|
[68] = "Blue",
|
||||||
|
[69] = "Blue",
|
||||||
|
[70] = "Blue",
|
||||||
|
[71] = "Blue",
|
||||||
|
[72] = "Blue",
|
||||||
|
[73] = "Blue",
|
||||||
|
[74] = "Blue",
|
||||||
|
[75] = "Blue",
|
||||||
|
[76] = "Blue",
|
||||||
|
[77] = "Blue",
|
||||||
|
[78] = "Blue",
|
||||||
|
[79] = "Bblue",
|
||||||
|
[80] = "Blue",
|
||||||
|
[81] = "Blue",
|
||||||
|
[82] = "Blue",
|
||||||
|
[83] = "Blue",
|
||||||
|
[84] = "Blue",
|
||||||
|
[85] = "Blue",
|
||||||
|
[86] = "Blue",
|
||||||
|
[87] = "Blue",
|
||||||
|
[88] = "Yellow",
|
||||||
|
[89] = "Yellow",
|
||||||
|
[90] = "Bronze",
|
||||||
|
[91] = "Yellow",
|
||||||
|
[92] = "Lime",
|
||||||
|
[93] = "Champagne",
|
||||||
|
[94] = "Beige",
|
||||||
|
[95] = "Ivory",
|
||||||
|
[96] = "Brown",
|
||||||
|
[97] = "Brown",
|
||||||
|
[98] = "Brown",
|
||||||
|
[99] = "Beige",
|
||||||
|
[100] = "Brown",
|
||||||
|
[101] = "Brown",
|
||||||
|
[102] = "Beechwood",
|
||||||
|
[103] = "Beechwood",
|
||||||
|
[104] = "Orange",
|
||||||
|
[105] = "Sand",
|
||||||
|
[106] = "Sand",
|
||||||
|
[107] = "Cream",
|
||||||
|
[108] = "Brown",
|
||||||
|
[109] = "Brown",
|
||||||
|
[110] = "Brown",
|
||||||
|
[111] = "White",
|
||||||
|
[112] = "White",
|
||||||
|
[113] = "Beige",
|
||||||
|
[114] = "Brown",
|
||||||
|
[115] = "Brown",
|
||||||
|
[116] = "Beige",
|
||||||
|
[117] = "Steel",
|
||||||
|
[118] = "Steel",
|
||||||
|
[119] = "Aluminium",
|
||||||
|
[120] = "Chrome",
|
||||||
|
[121] = "White",
|
||||||
|
[122] = "White",
|
||||||
|
[123] = "Orange",
|
||||||
|
[124] = "Orange",
|
||||||
|
[125] = "Green",
|
||||||
|
[126] = "Yellow",
|
||||||
|
[127] = "Blue",
|
||||||
|
[128] = "Green",
|
||||||
|
[129] = "Brown",
|
||||||
|
[130] = "Orange",
|
||||||
|
[131] = "White",
|
||||||
|
[132] = "White",
|
||||||
|
[133] = "Green",
|
||||||
|
[134] = "White",
|
||||||
|
[135] = "Pink",
|
||||||
|
[136] = "pink",
|
||||||
|
[137] = "Pink",
|
||||||
|
[138] = "Orange",
|
||||||
|
[139] = "Green",
|
||||||
|
[140] = "Blue",
|
||||||
|
[141] = "Black",
|
||||||
|
[142] = "Black",
|
||||||
|
[143] = "Black",
|
||||||
|
[144] = "Green",
|
||||||
|
[145] = "Purple",
|
||||||
|
[146] = "Blue",
|
||||||
|
[147] = "Black",
|
||||||
|
[148] = "Purple",
|
||||||
|
[149] = "Purple",
|
||||||
|
[150] = "Red",
|
||||||
|
[151] = "Green",
|
||||||
|
[152] = "Green",
|
||||||
|
[153] = "Brown",
|
||||||
|
[154] = "Tan",
|
||||||
|
[155] = "Green",
|
||||||
|
[156] = "ALLOY",
|
||||||
|
[157] = "Blue",
|
||||||
|
}
|
||||||
|
|
||||||
|
local vehicleClassNames = {
|
||||||
|
[0] = "Compact",
|
||||||
|
[1] = "Sedan",
|
||||||
|
[2] = "SUV",
|
||||||
|
[3] = "Coupe",
|
||||||
|
[4] = "Muscle",
|
||||||
|
[5] = "Sports Classic",
|
||||||
|
[6] = "Sport",
|
||||||
|
[7] = "Super",
|
||||||
|
[8] = "Motorcycle",
|
||||||
|
[9] = "Off-road",
|
||||||
|
[10] = "Industrial",
|
||||||
|
[11] = "Utility",
|
||||||
|
[12] = "Van",
|
||||||
|
[13] = "Cycle",
|
||||||
|
[14] = "Boat",
|
||||||
|
[15] = "Helicopter",
|
||||||
|
[16] = "Plane",
|
||||||
|
[17] = "Service",
|
||||||
|
[18] = "Emergency",
|
||||||
|
[19] = "Military",
|
||||||
|
[20] = "Commercial",
|
||||||
|
[21] = "Train",
|
||||||
|
[22] = "Open wheel"
|
||||||
|
}
|
||||||
|
|
||||||
local function getVehicleBlipSprite(entity)
|
local function getVehicleBlipSprite(entity)
|
||||||
if not IsEntityAVehicle(entity) then
|
if not IsEntityAVehicle(entity) then
|
||||||
return 148 -- circle blip
|
return 148 -- circle blip
|
||||||
@@ -125,7 +312,16 @@ AddStateBagChangeHandler("locked", nil, function(bagName, key, value, reserved,
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
lib.callback.register("ND_Vehicles:getProps", function()
|
lib.callback.register("ND_Vehicles:getProps", function()
|
||||||
return lib.getVehicleProperties(GetVehiclePedIsIn(cache.ped))
|
local veh = GetVehiclePedIsIn(cache.ped)
|
||||||
|
local props = lib.getVehicleProperties(veh)
|
||||||
|
local colorPrimary, colorSecondary = GetVehicleColours(veh)
|
||||||
|
props.colorNamePrimary = vehicleColorNames[colorPrimary]
|
||||||
|
props.colorNameSecondary = vehicleColorNames[colorSecondary]
|
||||||
|
props.colorName = props.colorNamePrimary == props.colorNameSecondary and props.colorNamePrimary or ("%s & %s"):format(props.colorNamePrimary, props.colorNameSecondary)
|
||||||
|
props.className = vehicleClassNames[GetVehicleClass(veh)]
|
||||||
|
props.makeName = GetLabelText(GetMakeNameFromVehicleModel(props.model))
|
||||||
|
props.modelName = GetLabelText(GetDisplayNameFromVehicleModel(props.model))
|
||||||
|
return props
|
||||||
end)
|
end)
|
||||||
|
|
||||||
lib.callback.register("ND_Vehicles:getNearbyVehicleById", function(vehId)
|
lib.callback.register("ND_Vehicles:getNearbyVehicleById", function(vehId)
|
||||||
|
|||||||
Reference in New Issue
Block a user