Вопрос Статтрек в инвентарь икеяваре

Пользователь
Статус
Оффлайн
Регистрация
8 Сен 2018
Сообщения
189
Реакции[?]
42
Поинты[?]
0
Всем привет, я тут пащу икеаваре и задался вопросом о добавлении статтрека в инвентарь.
Я посмотрел как работает изменение самого скина и решил таким же образом добавить статтрек, параллельно смотря в другой сурс с инвентарем.
В итоге после нескольких проб у меня вышли только ошибки: то в инвентаре не показывался статтрек, то он был не таким как я его выставил.

Может кто подсказать как его правильно добавить или скинуть код, который нужно вставить в void Inventory::AddItem?

Если что код в AddItem выглядит вот так:
C++:
void Inventory::AddItem(Writer& object, int index, int itemIndex, int rarity, int paintKit, int seed, float wear, int stat, std::string name)
{
    uint32_t steamid = g_SteamUser->GetSteamID().GetAccountID();

    Writer item(20);
    item.add(Field(CSOEconItem::id, TYPE_UINT64, (int64_t)index));
    item.add(Field(CSOEconItem::account_id, TYPE_UINT32, (int64_t)steamid));
    item.add(Field(CSOEconItem::def_index, TYPE_UINT32, (int64_t)itemIndex));
    item.add(Field(CSOEconItem::inventory, TYPE_UINT32, (int64_t)index));
    item.add(Field(CSOEconItem::origin, TYPE_UINT32, (int64_t)24));
    item.add(Field(CSOEconItem::quantity, TYPE_UINT32, (int64_t)1));
    item.add(Field(CSOEconItem::level, TYPE_UINT32, (int64_t)1));
    item.add(Field(CSOEconItem::style, TYPE_UINT32, (int64_t)0));
    item.add(Field(CSOEconItem::flags, TYPE_UINT32, (int64_t)0));
    item.add(Field(CSOEconItem::in_use, TYPE_BOOL, (int64_t)false));
    item.add(Field(CSOEconItem::original_id, TYPE_UINT64, (int64_t)itemIndex));
    if (is_uncommon(itemIndex))
        rarity++;
    if (is_knife(itemIndex) || is_glove(itemIndex))
    {
        item.add(Field(CSOEconItem::quality, TYPE_UINT32, (int64_t)3));
        rarity = 6;
    }
    item.add(Field(CSOEconItem::rarity, TYPE_UINT32, (int64_t)rarity));

    if (name.length() > 0)
        item.add(Field(CSOEconItem::custom_name, TYPE_STRING, name));

    // Paint Kit
    float _PaintKitAttributeValue = (float)paintKit;
    auto PaintKitAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _PaintKitAttributeValue), 4 };
    Writer PaintKitAttribute(3);
    PaintKitAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)6));
    PaintKitAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, PaintKitAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, PaintKitAttribute.serialize()));

    // Paint Seed
    float _SeedAttributeValue = (float)seed;
    auto SeedAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _SeedAttributeValue), 4 };
    Writer SeedAttribute(3);
    SeedAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)7));
    SeedAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, SeedAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, SeedAttribute.serialize()));

    // Paint Wear
    float _WearAttributeValue = wear;
    auto WearAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _WearAttributeValue), 4 };
    Writer WearAttribute(3);
    WearAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)8));
    WearAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, WearAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, WearAttribute.serialize()));

    object.add(Field(SubscribedType::object_data, TYPE_STRING, item.serialize()));
}
Если что могу отблагодарить копеечкой, заранее спасибо
 
Разработчик
Статус
Оффлайн
Регистрация
1 Сен 2018
Сообщения
1,596
Реакции[?]
879
Поинты[?]
113K
Всем привет, я тут пащу икеаваре и задался вопросом о добавлении статтрека в инвентарь.
Я посмотрел как работает изменение самого скина и решил таким же образом добавить статтрек, параллельно смотря в другой сурс с инвентарем.
В итоге после нескольких проб у меня вышли только ошибки: то в инвентаре не показывался статтрек, то он был не таким как я его выставил.

Может кто подсказать как его правильно добавить или скинуть код, который нужно вставить в void Inventory::AddItem?

Если что код в AddItem выглядит вот так:
C++:
void Inventory::AddItem(Writer& object, int index, int itemIndex, int rarity, int paintKit, int seed, float wear, int stat, std::string name)
{
    uint32_t steamid = g_SteamUser->GetSteamID().GetAccountID();

    Writer item(20);
    item.add(Field(CSOEconItem::id, TYPE_UINT64, (int64_t)index));
    item.add(Field(CSOEconItem::account_id, TYPE_UINT32, (int64_t)steamid));
    item.add(Field(CSOEconItem::def_index, TYPE_UINT32, (int64_t)itemIndex));
    item.add(Field(CSOEconItem::inventory, TYPE_UINT32, (int64_t)index));
    item.add(Field(CSOEconItem::origin, TYPE_UINT32, (int64_t)24));
    item.add(Field(CSOEconItem::quantity, TYPE_UINT32, (int64_t)1));
    item.add(Field(CSOEconItem::level, TYPE_UINT32, (int64_t)1));
    item.add(Field(CSOEconItem::style, TYPE_UINT32, (int64_t)0));
    item.add(Field(CSOEconItem::flags, TYPE_UINT32, (int64_t)0));
    item.add(Field(CSOEconItem::in_use, TYPE_BOOL, (int64_t)false));
    item.add(Field(CSOEconItem::original_id, TYPE_UINT64, (int64_t)itemIndex));
    if (is_uncommon(itemIndex))
        rarity++;
    if (is_knife(itemIndex) || is_glove(itemIndex))
    {
        item.add(Field(CSOEconItem::quality, TYPE_UINT32, (int64_t)3));
        rarity = 6;
    }
    item.add(Field(CSOEconItem::rarity, TYPE_UINT32, (int64_t)rarity));

    if (name.length() > 0)
        item.add(Field(CSOEconItem::custom_name, TYPE_STRING, name));

    // Paint Kit
    float _PaintKitAttributeValue = (float)paintKit;
    auto PaintKitAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _PaintKitAttributeValue), 4 };
    Writer PaintKitAttribute(3);
    PaintKitAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)6));
    PaintKitAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, PaintKitAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, PaintKitAttribute.serialize()));

    // Paint Seed
    float _SeedAttributeValue = (float)seed;
    auto SeedAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _SeedAttributeValue), 4 };
    Writer SeedAttribute(3);
    SeedAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)7));
    SeedAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, SeedAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, SeedAttribute.serialize()));

    // Paint Wear
    float _WearAttributeValue = wear;
    auto WearAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _WearAttributeValue), 4 };
    Writer WearAttribute(3);
    WearAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)8));
    WearAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, WearAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, WearAttribute.serialize()));

    object.add(Field(SubscribedType::object_data, TYPE_STRING, item.serialize()));
}
Если что могу отблагодарить копеечкой, заранее спасибо
C++:
    float _WearAttributeValue = wear;

    auto WearAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _WearAttributeValue), 4 };

    Writer WearAttribute(3);

    WearAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)8));

    WearAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, WearAttributeValue));

    item.add(Field(CSOEconItem::attribute, TYPE_STRING, WearAttribute.serialize()));
Даже логически код понятен:
WearAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)8)); - 8 это атрибут.
что-бы сделать статрек:
Меняем атрибут,ну и новые переменные завести по аналогу старых.

Код:
    always tradable - 1
    cannot trade - 2
    referenced item id low - 3
    referenced item id high - 4
    set item texture prefab - 6
    set item texture seed - 7
    set item texture wear - 8
    has silencer - 10
    has burst mode - 13
    cycletime when in burst mode - 14
    time between burst shots - 15
    unzoom after shot - 16
    cycletime when zoomed - 17
    cannot shoot underwater - 18
    in game price - 19
    primary clip size - 20
    secondary clip size - 21
    is full auto - 22
    heat per shot - 23
    addon scale - 24
    tracer frequency - 25
    max player speed - 26
    max player speed alt - 27
    armor ratio - 28
    crosshair min distance - 29
    crosshair delta distance - 30
    penetration - 31
    damage - 32
    range - 33
    range modifier - 34
    bullets - 35
    cycletime - 36
    time to idle - 37
    idle interval - 38
    flinch velocity modifier large - 39
    flinch velocity modifier small - 40
    spread - 41
    inaccuracy crouch - 42
    inaccuracy stand - 43
    inaccuracy jump - 44
    inaccuracy land - 45
    inaccuracy ladder - 46
    inaccuracy fire - 47
    inaccuracy move - 48
    spread alt - 49
    inaccuracy crouch alt - 50
    inaccuracy stand alt - 51
    inaccuracy jump alt - 52
    inaccuracy land alt - 53
    inaccuracy ladder alt - 54
    inaccuracy fire alt - 55
    inaccuracy move alt - 56
    recovery time crouch - 57
    recovery time stand - 58
    recoil seed - 59
    recoil angle - 60
    recoil angle variance - 61
    recoil magnitude - 62
    recoil magnitude variance - 63
    recoil angle alt - 64
    recoil angle variance alt - 65
    recoil magnitude alt - 66
    recoil magnitude variance alt - 67
    set supply crate series - 68
    minutes played - 69
    alternate icon - 70
    season access - 71
    disallow recycling - 72
    upgrade threshold - 73
    tradable after date - 75
    is revolver - 76
    elevate quality - 78
    cycletime alt - 79
    kill eater - 80
    kill eater score type - 81
    kill eater user 1 - 82
    kill eater user score type 1 - 83
    kill eater user 2 - 84
    kill eater user score type 2 - 85
    kill eater user 3 - 86
    kill eater user score type 3 - 87
    kill eater 2 - 88
    kill eater score type 2 - 89
    tracer frequency alt - 92
    primary default clip size - 93
    secondary default clip size - 94
    recipe filter - 95
    competitive kills - 97
    competitive 3k - 98
    competitive 4k - 99
    competitive 5k - 101
    competitive hsp - 102
    competitive wins - 103
    competitive mvps - 104
    competitive minutes played - 105
    match wins - 106
    preferred sort - 107
    custom name attr - 111
    custom desc attr - 112
    sticker slot 0 id - 113
    sticker slot 0 wear - 114
    sticker slot 0 scale - 115
    sticker slot 0 rotation - 116
    sticker slot 1 id - 117
    sticker slot 1 wear - 118
    sticker slot 1 scale - 119
    sticker slot 1 rotation - 120
    sticker slot 2 id - 121
    sticker slot 2 wear - 122
    sticker slot 2 scale - 123
    sticker slot 2 rotation - 124
    sticker slot 3 id - 125
    sticker slot 3 wear - 126
    sticker slot 3 scale - 127
    sticker slot 3 rotation - 128
    sticker slot 4 id - 129
    sticker slot 4 wear - 130
    sticker slot 4 scale - 131
    sticker slot 4 rotation - 132
    sticker slot 5 id - 133
    sticker slot 5 wear - 134
    sticker slot 5 scale - 135
    sticker slot 5 rotation - 136
    tournament event id - 137
    tournament event stage id - 138
    tournament event team0 id - 139
    tournament event team1 id - 140
    icon display model - 142
    buymenu display model - 143
    pedestal display model - 144
    magazine model - 145
    uid model - 146
    stattrak model - 147
    aimsight capable - 150
    aimsight eye pos - 151
    aimsight pivot angle - 154
    aimsight speed up - 157
    aimsight speed down - 158
    aimsight looseness - 159
    aimsight fov - 160
    aimsight pivot forward - 161
    gifter account id - 162
    aimsight lens mask - 165
    music id - 166
    quest id - 168
    quest points remaining - 169
    quest reward lootlist - 170
    quests complete - 171
    operation kills - 172
    operation 3k - 173
    operation 4k - 174
    operation 5k - 175
    operation hsp - 176
    operation mvps - 177
    operation minutes played - 178
    operation wins - 179
    deployment date - 180
    use after date - 182
    expiration date - 183
    campaign id - 184
    campaign completion bitfield - 185
    last campaign completion - 187
    operation points - 188
    zoom time 0 - 190
    zoom time 1 - 191
    zoom time 2 - 192
    zoom fov 1 - 193
    zoom fov 2 - 194
    hide view model zoomed - 195
    zoom levels - 196
    kill award - 197
    primary reserve ammo max - 199
    secondary reserve ammo max - 200
    campaign 1 completion bitfield - 208
    campaign 1 last completed quest - 209
    campaign 2 completion bitfield - 210
    campaign 2 last completed quest - 211
    campaign 3 completion bitfield - 212
    campaign 3 last completed quest - 213
    campaign 4 completion bitfield - 214
    campaign 4 last completed quest - 215
    campaign 5 completion bitfield - 216
    campaign 5 last completed quest - 217
    campaign 6 completion bitfield - 218
    campaign 6 last completed quest - 219
    operation bonus points - 220
    prestige year - 221
    issue date - 222
    tournament mvp account id - 223
    campaign 7 completion bitfield - 224
    campaign 7 last completed quest - 225
    campaign 8 completion bitfield - 226
    campaign 8 last completed quest - 227
    recovery time crouch final - 228
    recovery time stand final - 229
    recovery transition start bullet - 230
    recovery transition end bullet - 231
    sprays remaining - 232
    spray tint id - 233
    inaccuracy jump initial - 234
    campaign 9 completion bitfield - 235
    campaign 9 last completed quest - 236
    operation drops awarded 1 - 237
    operation xp awarded 0 - 238
    operation xp awarded 1 - 239
    operation drops awarded 0 - 240
    attack movespeed factor - 242
    allow hand flipping - 243
    is melee weapon - 245
    model right handed - 246
    weapon weight - 247
    wrong team msg - 248
    itemflag select on empty - 249
    itemflag no auto reload - 250
    itemflag no auto switch empty - 251
    itemflag limit in world - 252
    itemflag exhaustible - 253
    itemflag do hit location dmg - 254
    itemflag no ammo pickups - 255
    itemflag no item pickup - 256
    inaccuracy reload - 257
    throw velocity - 259
    bot audible range - 261
    rumble effect - 262
    inaccuracy pitch shift - 263
    inaccuracy alt sound threshold - 264
    silencer model - 265
    spread seed - 266
 
Пользователь
Статус
Оффлайн
Регистрация
8 Сен 2018
Сообщения
189
Реакции[?]
42
Поинты[?]
0
C++:
    float _WearAttributeValue = wear;

    auto WearAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _WearAttributeValue), 4 };

    Writer WearAttribute(3);

    WearAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)8));

    WearAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, WearAttributeValue));

    item.add(Field(CSOEconItem::attribute, TYPE_STRING, WearAttribute.serialize()));
Даже логически код понятен:
WearAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)8)); - 8 это атрибут.
что-бы сделать статрек:
Меняем атрибут,ну и новые переменные завести по аналогу старых.

Код:
    always tradable - 1
    cannot trade - 2
    referenced item id low - 3
    referenced item id high - 4
    set item texture prefab - 6
    set item texture seed - 7
    set item texture wear - 8
    has silencer - 10
    has burst mode - 13
    cycletime when in burst mode - 14
    time between burst shots - 15
    unzoom after shot - 16
    cycletime when zoomed - 17
    cannot shoot underwater - 18
    in game price - 19
    primary clip size - 20
    secondary clip size - 21
    is full auto - 22
    heat per shot - 23
    addon scale - 24
    tracer frequency - 25
    max player speed - 26
    max player speed alt - 27
    armor ratio - 28
    crosshair min distance - 29
    crosshair delta distance - 30
    penetration - 31
    damage - 32
    range - 33
    range modifier - 34
    bullets - 35
    cycletime - 36
    time to idle - 37
    idle interval - 38
    flinch velocity modifier large - 39
    flinch velocity modifier small - 40
    spread - 41
    inaccuracy crouch - 42
    inaccuracy stand - 43
    inaccuracy jump - 44
    inaccuracy land - 45
    inaccuracy ladder - 46
    inaccuracy fire - 47
    inaccuracy move - 48
    spread alt - 49
    inaccuracy crouch alt - 50
    inaccuracy stand alt - 51
    inaccuracy jump alt - 52
    inaccuracy land alt - 53
    inaccuracy ladder alt - 54
    inaccuracy fire alt - 55
    inaccuracy move alt - 56
    recovery time crouch - 57
    recovery time stand - 58
    recoil seed - 59
    recoil angle - 60
    recoil angle variance - 61
    recoil magnitude - 62
    recoil magnitude variance - 63
    recoil angle alt - 64
    recoil angle variance alt - 65
    recoil magnitude alt - 66
    recoil magnitude variance alt - 67
    set supply crate series - 68
    minutes played - 69
    alternate icon - 70
    season access - 71
    disallow recycling - 72
    upgrade threshold - 73
    tradable after date - 75
    is revolver - 76
    elevate quality - 78
    cycletime alt - 79
    kill eater - 80
    kill eater score type - 81
    kill eater user 1 - 82
    kill eater user score type 1 - 83
    kill eater user 2 - 84
    kill eater user score type 2 - 85
    kill eater user 3 - 86
    kill eater user score type 3 - 87
    kill eater 2 - 88
    kill eater score type 2 - 89
    tracer frequency alt - 92
    primary default clip size - 93
    secondary default clip size - 94
    recipe filter - 95
    competitive kills - 97
    competitive 3k - 98
    competitive 4k - 99
    competitive 5k - 101
    competitive hsp - 102
    competitive wins - 103
    competitive mvps - 104
    competitive minutes played - 105
    match wins - 106
    preferred sort - 107
    custom name attr - 111
    custom desc attr - 112
    sticker slot 0 id - 113
    sticker slot 0 wear - 114
    sticker slot 0 scale - 115
    sticker slot 0 rotation - 116
    sticker slot 1 id - 117
    sticker slot 1 wear - 118
    sticker slot 1 scale - 119
    sticker slot 1 rotation - 120
    sticker slot 2 id - 121
    sticker slot 2 wear - 122
    sticker slot 2 scale - 123
    sticker slot 2 rotation - 124
    sticker slot 3 id - 125
    sticker slot 3 wear - 126
    sticker slot 3 scale - 127
    sticker slot 3 rotation - 128
    sticker slot 4 id - 129
    sticker slot 4 wear - 130
    sticker slot 4 scale - 131
    sticker slot 4 rotation - 132
    sticker slot 5 id - 133
    sticker slot 5 wear - 134
    sticker slot 5 scale - 135
    sticker slot 5 rotation - 136
    tournament event id - 137
    tournament event stage id - 138
    tournament event team0 id - 139
    tournament event team1 id - 140
    icon display model - 142
    buymenu display model - 143
    pedestal display model - 144
    magazine model - 145
    uid model - 146
    stattrak model - 147
    aimsight capable - 150
    aimsight eye pos - 151
    aimsight pivot angle - 154
    aimsight speed up - 157
    aimsight speed down - 158
    aimsight looseness - 159
    aimsight fov - 160
    aimsight pivot forward - 161
    gifter account id - 162
    aimsight lens mask - 165
    music id - 166
    quest id - 168
    quest points remaining - 169
    quest reward lootlist - 170
    quests complete - 171
    operation kills - 172
    operation 3k - 173
    operation 4k - 174
    operation 5k - 175
    operation hsp - 176
    operation mvps - 177
    operation minutes played - 178
    operation wins - 179
    deployment date - 180
    use after date - 182
    expiration date - 183
    campaign id - 184
    campaign completion bitfield - 185
    last campaign completion - 187
    operation points - 188
    zoom time 0 - 190
    zoom time 1 - 191
    zoom time 2 - 192
    zoom fov 1 - 193
    zoom fov 2 - 194
    hide view model zoomed - 195
    zoom levels - 196
    kill award - 197
    primary reserve ammo max - 199
    secondary reserve ammo max - 200
    campaign 1 completion bitfield - 208
    campaign 1 last completed quest - 209
    campaign 2 completion bitfield - 210
    campaign 2 last completed quest - 211
    campaign 3 completion bitfield - 212
    campaign 3 last completed quest - 213
    campaign 4 completion bitfield - 214
    campaign 4 last completed quest - 215
    campaign 5 completion bitfield - 216
    campaign 5 last completed quest - 217
    campaign 6 completion bitfield - 218
    campaign 6 last completed quest - 219
    operation bonus points - 220
    prestige year - 221
    issue date - 222
    tournament mvp account id - 223
    campaign 7 completion bitfield - 224
    campaign 7 last completed quest - 225
    campaign 8 completion bitfield - 226
    campaign 8 last completed quest - 227
    recovery time crouch final - 228
    recovery time stand final - 229
    recovery transition start bullet - 230
    recovery transition end bullet - 231
    sprays remaining - 232
    spray tint id - 233
    inaccuracy jump initial - 234
    campaign 9 completion bitfield - 235
    campaign 9 last completed quest - 236
    operation drops awarded 1 - 237
    operation xp awarded 0 - 238
    operation xp awarded 1 - 239
    operation drops awarded 0 - 240
    attack movespeed factor - 242
    allow hand flipping - 243
    is melee weapon - 245
    model right handed - 246
    weapon weight - 247
    wrong team msg - 248
    itemflag select on empty - 249
    itemflag no auto reload - 250
    itemflag no auto switch empty - 251
    itemflag limit in world - 252
    itemflag exhaustible - 253
    itemflag do hit location dmg - 254
    itemflag no ammo pickups - 255
    itemflag no item pickup - 256
    inaccuracy reload - 257
    throw velocity - 259
    bot audible range - 261
    rumble effect - 262
    inaccuracy pitch shift - 263
    inaccuracy alt sound threshold - 264
    silencer model - 265
    spread seed - 266
Да, я это понимаю и знаю что мне нужно установить атрибуты 80 и 81.
Я просто сверяю то что делаю сам с другими, более старыми сурсами с инвентариченджером.


Тут все очень просто, есть лишь 2 значения которые нужно подставить и добавить туда любой атрибут не составит никакого труда.
Но я хочу именно разобраться с работой инвентаря в икеаваре, там это сделано как-то слишком хитро для меня.

Если не сложно, то все же подскажите что и где заменить, чтобы все работало. Более ничего не требуется.
Переменные я уже завел, в самой игре статтрек работает стабильно, а вот в инвентарь нормально добавляться не хочет.

Кстати, по какой-то причине простая замена атрибутов не решает проблему, так что ваше сообщение мне ничуть не помогло.
C++:
        Writer stattrackAttribute(3);
        stattrackAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)80));
        stattrackAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)81));
        item.add(Field(CSOEconItem::attribute, TYPE_STRING, stattrackAttribute.serialize()));
 
Разработчик
Статус
Оффлайн
Регистрация
1 Сен 2018
Сообщения
1,596
Реакции[?]
879
Поинты[?]
113K
Да, я это понимаю и знаю что мне нужно установить атрибуты 80 и 81.
Я просто сверяю то что делаю сам с другими, более старыми сурсами с инвентариченджером.


Тут все очень просто, есть лишь 2 значения которые нужно подставить и добавить туда любой атрибут не составит никакого труда.
Но я хочу именно разобраться с работой инвентаря в икеаваре, там это сделано как-то слишком хитро для меня.

Если не сложно, то все же подскажите что и где заменить, чтобы все работало. Более ничего не требуется.
Переменные я уже завел, в самой игре статтрек работает стабильно, а вот в инвентарь нормально добавляться не хочет.

Кстати, по какой-то причине простая замена атрибутов не решает проблему, так что ваше сообщение мне ничуть не помогло.
C++:
        Writer stattrackAttribute(3);
        stattrackAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)80));
        stattrackAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)81));
        item.add(Field(CSOEconItem::attribute, TYPE_STRING, stattrackAttribute.serialize()));
C++:
    float _StatAttributeValue = 999;

    auto StatAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _StatAttributeValue), 4 };

    Writer StatAttribute(3);

    StatAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)81));

    StatAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, StatAttributeValue));

    item.add(Field(CSOEconItem::attribute, TYPE_STRING, StatAttribute.serialize()));
 
Пользователь
Статус
Оффлайн
Регистрация
8 Сен 2018
Сообщения
189
Реакции[?]
42
Поинты[?]
0
C++:
    float _StatAttributeValue = 999;

    auto StatAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _StatAttributeValue), 4 };

    Writer StatAttribute(3);

    StatAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)81));

    StatAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, StatAttributeValue));

    item.add(Field(CSOEconItem::attribute, TYPE_STRING, StatAttribute.serialize()));
Вставил вот так:
C++:
void Inventory::AddItem(Writer& object, int index, int itemIndex, int rarity, int paintKit, int seed, float wear, int stattrack, std::string name)
{
    uint32_t steamid = g_SteamUser->GetSteamID().GetAccountID();

    Writer item(19);
    item.add(Field(CSOEconItem::id, TYPE_UINT64, (int64_t)index));
    item.add(Field(CSOEconItem::account_id, TYPE_UINT32, (int64_t)steamid));
    item.add(Field(CSOEconItem::def_index, TYPE_UINT32, (int64_t)itemIndex));
    item.add(Field(CSOEconItem::inventory, TYPE_UINT32, (int64_t)index));
    item.add(Field(CSOEconItem::origin, TYPE_UINT32, (int64_t)24));
    item.add(Field(CSOEconItem::quantity, TYPE_UINT32, (int64_t)1));
    item.add(Field(CSOEconItem::level, TYPE_UINT32, (int64_t)1));
    item.add(Field(CSOEconItem::style, TYPE_UINT32, (int64_t)0));
    item.add(Field(CSOEconItem::flags, TYPE_UINT32, (int64_t)0));
    item.add(Field(CSOEconItem::in_use, TYPE_BOOL, (int64_t)false));
    item.add(Field(CSOEconItem::original_id, TYPE_UINT64, (int64_t)itemIndex));
    if (is_uncommon(itemIndex))
        rarity++;
    else if (is_knife(itemIndex) || is_glove(itemIndex))
    {
        item.add(Field(CSOEconItem::quality, TYPE_UINT32, (int64_t)3));
        rarity = 6;
    }
    item.add(Field(CSOEconItem::rarity, TYPE_UINT32, (int64_t)rarity));

    if (name.length() > 0)
        item.add(Field(CSOEconItem::custom_name, TYPE_STRING, name));

    // Paint Kit
    float _PaintKitAttributeValue = (float)paintKit;
    auto PaintKitAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _PaintKitAttributeValue), 4 };
    Writer PaintKitAttribute(3);
    PaintKitAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)6));
    PaintKitAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, PaintKitAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, PaintKitAttribute.serialize()));

    // Paint Seed
    float _SeedAttributeValue = (float)seed;
    auto SeedAttributeValue = std::string{ reinterpret_cast<const char*>((void*)&_SeedAttributeValue), 4 };
    Writer SeedAttribute(3);
    SeedAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)7));
    SeedAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, SeedAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, SeedAttribute.serialize()));

    // Paint Wear
    float _WearAttributeValue = wear;
    auto WearAttributeValue = std::string{ reinterpret_cast<const char*>((void*)& _WearAttributeValue), 4 };
    Writer WearAttribute(3);
    WearAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)8));
    WearAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, WearAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, WearAttribute.serialize()));

    //Stattrack
    float _StatAttributeValue = 999;
    auto StatAttributeValue = std::string{ reinterpret_cast<const char*>((void*)&_StatAttributeValue), 4 };
    Writer StatAttribute(3);
    StatAttribute.add(Field(CSOEconItemAttribute::def_index, TYPE_UINT32, (int64_t)81));
    StatAttribute.add(Field(CSOEconItemAttribute::value_bytes, TYPE_STRING, StatAttributeValue));
    item.add(Field(CSOEconItem::attribute, TYPE_STRING, StatAttribute.serialize()));


    object.add(Field(SubscribedType::object_data, TYPE_STRING, item.serialize()));
}

Скрины после добавления оружия в инвентарь:

Я что-то не так делаю? Могу скинуть любой файл если нужно
 
Сверху Снизу