OFFSET_PRIMARYWEAPON issue
Ok so i have tried a few different things and cant figure out what it actually returns.
ive tried using ID offset to get CSW and that didnt work. so... what does it actually return? i cant seem to find much info on it. and the only way i have an example of it being used is.. PHP Code:
|
Re: OFFSET_PRIMARYWEAPON issue
Seems to be just a boolean value, only for showing if player has a primary weapon or not.
|
Re: OFFSET_PRIMARYWEAPON issue
Quote:
PHP Code:
|
Re: OFFSET_PRIMARYWEAPON issue
Set on 1, this offset prevents players from pigking up armoury_entity weapons, but not weaponbox.
|
Re: OFFSET_PRIMARYWEAPON issue
Quote:
to allow my engineer to give ammo. |
Re: OFFSET_PRIMARYWEAPON issue
So you don't know how to check which weapons a player have.
You can check get_pdata_cbase(id, with slots offsets (m_rgpPlayerItems), you will retrieve the first weapon a player have on each slot. Then, if there is another weapon in this slot, the next weapon is linked to first weapon with weapon offset m_pNext (cbase), etc... Player offsets, linux diff = 5 367-372 m_rgpPlayerItems[MAX_ITEM_TYPES] // 6 (cbase) 367 is not used, 368 is first slot. Weapon offset, linux extra offset = 4 #define m_pNext 42 So, suppose i have an ak47 (entity 53 for example), a m4a1 (ent 57), a deagle (60), a glock (63) and an usp (65) get_pdata_cbase(id, m_rgpPlayerItems_1 /* 368 */, 5) == 53 get_pdata_cbase(53, m_pNext, 4) == 57 get_pdata_cbase(57, m_pNext, 4) == 0 or -1 depending on linux/windows get_pdata_cbase(id, m_rgpPlayerItems_2 /* 369 */, 5) == 60 get_pdata_cbase(60, m_pNext, 4) == 63 get_pdata_cbase(63, m_pNext, 4) == 65 get_pdata_cbase(65, m_pNext, 4) == 0 or -1 depending on linux/windows Same method is used to know which weapons are in a weaponbox (if no plugin/addon change normal cs behavior, only 1 weapon is stored in a weaponbox). For player weapons, you can also check pev_weapons bitsum, but it can, if you don't check it at the right moment (during strip process for example) return false results, should be reliable though, it's the way amxx uses for get_user_weapons and has_user_weapon natives. |
| All times are GMT -4. The time now is 03:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.