Item
FivePD.API.Utils
#
Namespace: Source/Utils/Item.cs
#
File: The Item class contains item related information.
You can use this class to create Item instances, which can be used to set ped items / vehicle items. (using SetPedData()
or SetVehicleData()
)
#
Fields#
NameType:stringThe name of the item.
#
IsIllegalType:boolWhether the item is illegal.
#
UsageItem creation
Item violation = new Item();Item.Name = "Test Item";Item.IsIllegal = false;
To get items from a ped
Ped ped;...PedData pedData = await ped.GetData();List<Item> pedItems = pedData.Items;
foreach(var item in pedItems) Debug.WriteLine(item.Name); // Prints the name of each item
To get items from a vehicle
Vehicle vehicle;...VehicleData vehData = await vehicle.GetData();List<Item> vehItems = vehData.Items;
foreach(var item in vehItems) Debug.WriteLine(item.Name); // Prints the name of each item