Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WI_SLOT for rg_get_weapon_info #272

Closed
SergeyShorokhov opened this issue Apr 10, 2023 · 0 comments · Fixed by #292
Closed

Add WI_SLOT for rg_get_weapon_info #272

SergeyShorokhov opened this issue Apr 10, 2023 · 0 comments · Fixed by #292

Comments

@SergeyShorokhov
Copy link
Member

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]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant