Raised This Month: $ Target: $400
 0% 

Catch legs and arms shot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-16-2009 , 01:21   Re: Catch legs and arms shot
Reply With Quote #1

say i want HIT_RIGHTARM and HIT_LEFTARM to call this function

and the legs to call anohter how would i do that i dont really understand thiskinda stuff to behonest withyou guys...

Just trying to expand on my VR(Virtual Reality) plugin
Doc-Holiday is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-16-2009 , 01:57   Re: Catch legs and arms shot
Reply With Quote #2

Quote:
Originally Posted by NcB_Sav View Post
say i want HIT_RIGHTARM and HIT_LEFTARM to call this function

and the legs to call anohter how would i do that i dont really understand thiskinda stuff to behonest withyou guys...

Just trying to expand on my VR(Virtual Reality) plugin
Using ConnorMcLeods code, edit the portion to this:

PHP Code:
    switch( get_tr2(trTR_iHitgroup) )
    {
        case 
HIT_LEFTARM ,HIT_RIGHTARM:
        {
            
//call arm hit function
        
}
        case 
HIT_LEFTLEG,HIT_RIGHTLEG:
        {
            
//call leg hit function
        
}
    } 
__________________
Bugsy is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-16-2009 , 02:20   Re: Catch legs and arms shot
Reply With Quote #3

Thanks but it gives me these errors

/home/groups/amxmodx/tmp3/phpmySI2v.sma(60 -- 61) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpmySI2v.sma(66 -- 67) : error 029: invalid expression, assumed zero


on those 2 case's

edit... i lied lol didnt see :

Last edited by Doc-Holiday; 01-16-2009 at 02:34.
Doc-Holiday is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-16-2009 , 06:51   Re: Catch legs and arms shot
Reply With Quote #4

Dunno what you exactly do, but i could be better to only hook TakeDamage POST, then retrieve the actual damage with pev_dmg_take, and hitgroup with offset 75 :

75 - m_LastHitGroup
76 - m_bitsDamageType

http://forums.alliedmods.net/showthread.php?t=68113
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-16-2009 , 12:38   Re: Catch legs and arms shot
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Dunno what you exactly do, but i could be better to only hook TakeDamage POST, then retrieve the actual damage with pev_dmg_take, and hitgroup with offset 75 :

75 - m_LastHitGroup
76 - m_bitsDamageType

http://forums.alliedmods.net/showthread.php?t=68113
basically if your shot in the leg i want it to slow you down.
if shot in arm weapon shake
Doc-Holiday is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-16-2009 , 14:41   Re: Catch legs and arms shot
Reply With Quote #6

Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> #define m_LastHitGroup 75 new ScreenShake; public plugin_init() {     RegisterHam(Ham_TakeDamage, "player", "FwdPlayerDamage", 1);         ScreenShake = get_user_msgid("ScreenShake"); } public FwdPlayerDamage(client, inflictor, attacker, Float:damage, damagebits) {     if( !is_user_alive(client) ) return HAM_IGNORED;         switch( get_pdata_int(client, m_LastHitGroup) )     {         case HIT_LEFTARM, HIT_RIGHTARM:         {             message_begin(MSG_ONE, ScreenShake, _, client);             write_byte(255<<14);             write_byte(10<<14);             write_byte(255<<14);             message_end();         }         case HIT_LEFTLEG, HIT_RIGHTLEG:         {             new Float:velocity[3];             pev(client, pev_velocity, velocity);                         if( pev(client, pev_flags) & FL_ONGROUND )             {                 velocity[0] *= 0.25;                 velocity[1] *= 0.25;             }             else             {                 velocity[0] *= 1.5;                 velocity[1] *= 1.5;             }                         set_pev(client, pev_velocity, velocity)         }     }         return HAM_HANDLED; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 01-16-2009 , 21:48   Re: Catch legs and arms shot
Reply With Quote #7

Just checking, are these offsets CS-only or do they work for all mods?
__________________

Community / No support through PM
danielkza 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 01:39.


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