37 {
38 if ( action_data.m_MainItem && action_data.m_MainItem.GetHierarchyRootPlayer() == action_data.m_Player )
39 {
40 string path =
"CfgVehicles " + action_data.m_MainItem.GetType();
41 string child_name = "";
42 int count;
43 array<string> resources = new array<string>;
44
46 {
49 for (int i = 0; i < count; i++)
50 {
52
53 if (
GetGame().ConfigGetInt(
path +
" " + child_name +
" value" ) )
54 {
55 resources.Insert( child_name );
56 }
57 }
58
59
60 string itemType = resources.Get(0);
62
63 UnboxLambda lambda = new UnboxLambda(action_data.m_MainItem, itemType, action_data.m_Player, itemCount);
64 action_data.m_Player.ServerReplaceItemInHandsWithNew(lambda);
65 }
66 }
67 }
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native CGame GetGame()