Well it seems as though i found the armor type offset, and so i thought id post that also.
On a windows box, its on offset 112. Below I remade the armor purchase function, for a rather large plugin im writing, right now.
Code:
#define OFFSET_ARMOR_TYPE 112
#define OFFSET_ARMOR_TYPE_AMD64 137
native is_amd64_server();
public armor_buy( id, bool:bAssault )
{
//iArmorType will be 0-No Armor 1-Kevlar 2-AssaultSuit
new iArmorType;
if ( is_amd64_server() ) iArmorType = get_pdata_int( id, OFFSET_ARMOR_TYPE_AMD64, 0);
else iArmorType = get_pdata_int( id, OFFSET_ARMOR_TYPE);
new iArmor = get_user_armor( id );
new baseline = 0;
new cost = 0;
if ( iArmor == 100) baseline += 1;
if ( iArmorType == 2) baseline += 2;
if ( bAssault == true) baseline += 4;
switch( baseline ){
//NA-->kevlar
case 0:
cost = 650;
//100kevlar-->kevlar
case 1:
client_print( id, print_center, "You already have kevlar!" );
//<100assault-->kevlar
case 2:
cost = 650;
//100assault-->kevlar
case 3:
client_print( id, print_center, "You already have kevlar!" );
//NA-->assault or <100kevlar-->assault
case 4:
cost = 1000;
//100kevlar-->assault
case 5:
cost = 350;
//<100assault-->assault
case 6:
cost = 650;
//100assault-->assault
case 7:
client_print( id, print_center, "You already have kevlar!" );
}
if( (hasMoney( id, cost )) && (cost != 0) ){
if( bAssault ) give_item(id, "item_assaultsuit");
else give_item(id, "item_kevlar");
changeMoney( id, -cost, 1);
}
}
__________________