AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hitzones bytes? (https://forums.alliedmods.net/showthread.php?t=12623)

BioHazardousWaste 04-19-2005 23:13

Hitzones bytes?
 
Anyone know the hitzone bytes? I found this list:

Quote:

1 - generic
2 - head
4 - chest
8 - stomach
16 - left arm
32 - right arm
64 - left leg
128 - right leg
but it is incorrect, because I cought the damage event and did a point black deagle shot to the head for 182 dmg, and no msg saying congratz on the hs u got x bonus experience... but in a random firefight i got the message, so obviously there is somthing wrong with the hitzones.

Code:

          //bonus exp for HITTING target
          if (HitZone == 2)
          {
                  HitExp += 4
                 
                  //tell player
                client_print(Enemy,print_chat,"You are awarded 4 bonus exp for a headshot!")
        }

And, sorta off topic but how big is a "integer" in small? like if itype new myvar what's the max value myvar can hold before crashing? thanx.

XxAvalanchexX 04-19-2005 23:34

The list you posted is for the bitmask, which I don't believe is used in this case. Try using these instead:

Code:
/* Parts of body for hits */ #define HIT_GENERIC     0   /* none */ #define HIT_HEAD        1 #define HIT_CHEST       2 #define HIT_STOMACH     3 #define HIT_LEFTARM     4 #define HIT_RIGHTARM        5 #define HIT_LEFTLEG     6 #define HIT_RIGHTLEG        7

(already defined in amxconst.inc)

v3x 04-19-2005 23:47

Just add em up now.. (Sorry, no time to explain, gotta hit the Zzz's!)

Freecode 04-20-2005 00:23

if( HitZone & 2)

n0obie4life 04-20-2005 03:23

Quote:

Originally Posted by XxAvalanchexX
The list you posted is for the bitmask, which I don't believe is used in this case. Try using these instead:

Code:
/* Parts of body for hits */ #define HIT_GENERIC     0   /* none */ #define HIT_HEAD        1 #define HIT_CHEST       2 #define HIT_STOMACH     3 #define HIT_LEFTARM     4 #define HIT_RIGHTARM        5 #define HIT_LEFTLEG     6 #define HIT_RIGHTLEG        7

(already defined in amxconst.inc)

how bout if i want left and right :D.

NiGHTFiRE 04-20-2005 09:54

I'm not sure but i think you add em up then.

BigWalnutZ 04-20-2005 10:05

I have zero knowledge on this but adding them makes no sense. If you put 3 it could be head and chest or stomach. This is not the standard 1, 2, 4, 8, 16, ...etc. I don't think it works like bitwise

XxAvalanchexX 04-20-2005 13:49

Quote:

Originally Posted by BigWalnutZ
I have zero knowledge on this but adding them makes no sense. If you put 3 it could be head and chest or stomach. This is not the standard 1, 2, 4, 8, 16, ...etc. I don't think it works like bitwise

I didn't post a bitmask, I posted simple number defines for different hitboxes, defines already defined by the AMXx team, thus proving they must be there for a reason.

I'm not sure what the point of a bitmask for hitboxes is, because I don't believe you can shoot someone in two different hitboxes at once.

BioHazardousWaste 04-20-2005 15:09

Shooting someone in two different hit boxes at once? Now that would be some nice skills! lol

Thanks for the help, I will try that. I know that the bits work fine, but if you look it said head was 2 and not 1. I think that's the problem. Oh, and sort of off topic, but a nub question here; how are cvars used? And don't they make for some ugly coding instead of using internal vars? Because I want all the exp and stuff to be a cvar...

XxAvalanchexX 04-20-2005 15:51

Of course it said that the head was 2 and not 1, it's a different system! Maybe that's why yours wasn't working, perhaps? Hmm...


All times are GMT -4. The time now is 09:59.

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