Skip to content

Add WI_SLOT for rg_get_weapon_info #272

@wopox1337

Description

@wopox1337

Add WI_SLOT to:
https://github.com/s1lentq/reapi/blob/60f32302ee7dff1c508533499ed6fdfd2a681ed5/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc#L62-L66

Usage example:

new InventorySlotType: slot = rg_get_weapon_info(rg_get_weapon_info("weapon_ak47", WI_ID), WI_SLOT) // PRIMARY_WEAPON_SLOT

Get it from ReGameDLL:
https://github.com/s1lentq/ReGameDLL_CS/blob/e090a52846c769f21eaf40e20d4e1f6082e62bb3/regamedll/dlls/weapontype.cpp#L560-L569

temporary solution:

static stock InventorySlotType: GetWeaponSlot(const weaponId) {
    static const weaponSlotInfo[] = {0,2,0,1,4,1,5,1,1,4,2,2,1,1,1,1,2,2,1,1,1,1,1,1,1,4,2,1,1,3,1}

    if (weaponId < 0 || weaponId >= sizeof(weaponSlotInfo))
        return NONE_SLOT
    
    return InventorySlotType: weaponSlotInfo[weaponId]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions