Raised This Month: $51 Target: $400
 12% 

Finding armor Type, with fakemeta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ronkkrop
Member
Join Date: May 2004
Old 12-17-2004 , 08:18   Finding armor Type, with fakemeta
Reply With Quote #1

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);     }     }
__________________
"I refuse to join any club that would have me as a member."
--Groucho Marx
Ronkkrop is offline
Send a message via ICQ to Ronkkrop Send a message via AIM to Ronkkrop Send a message via MSN to Ronkkrop Send a message via Yahoo to Ronkkrop
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 12-17-2004 , 11:43  
Reply With Quote #2

You are indeed right, I never remember to make something out of these.
Johnny got his gun is offline
BAILOPAN
Join Date: Jan 2004
Old 12-17-2004 , 13:20  
Reply With Quote #3

Perhaps it's time to make an AMD64 offset parameter.
__________________
egg
BAILOPAN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode