I found the offsets for shield, and armor type, and they are as follows;
cstrike.h:
Code:
#if !defined __amd64__
#define OFFSET_SHIELD 510 + EXTRAOFFSET
#define OFFSET_ARMOR_TYPE 112 + EXTRAOFFSET
#else
#define OFFSET_SHIELD 559 + EXTRAOFFSET
#define OFFSET_ARMOR_TYPE 137 + EXTRAOFFSET
#endif
#define HAS_SHIELD (1<<24) //16777216
cstrike.cpp:
Code:
static cell AMX_NATIVE_CALL cs_get_user_armortype(AMX *amx, cell *params)
{
//Returns 0= no armor, 1=vest(kevlar), 2=vesthelm(assaultsuit)
//simply returns the value at the offset
//params[1] = user id
// Valid entity should be within range
CHECK_PLAYER(params[1]);
// Make into edict pointer
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
return *((int *)pPlayer->pvPrivateData + OFFSET_ARMOR_TYPE);
}
Code:
static cell AMX_NATIVE_CALL cs_user_has_shield(AMX *amx, cell *params)
{
//Return 1 if user has a shield.
//params[1] = user id
//Check player
CHECK_PLAYER(params[1]);
// Make into edict pointer
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_SHIELD) & HAS_SHIELD)
return 1;
return 0;
}
__________________