Raised This Month: $ Target: $400
 0% 

Damage Angle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-31-2009 , 23:22   Damage Angle
Reply With Quote #1

Does anyone know the damage angle codes ?

meaning like someone hit you. your angle will change to weird angle like this in the video. look carefully at 1.06 when the zombie hit the victim.
Mr.Noobie is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-31-2009 , 23:25   Re: Damage Angle
Reply With Quote #2

I believe that is called "punchangle"
__________________
fysiks is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 05-31-2009 , 23:46   Re: Damage Angle
Reply With Quote #3

Engine:

Code:
new Float:fAngle[3] //... entity_set_vector(id, EV_VEC_punchangle, fAngle)

FakeMeta:

Code:
new Float:fAngle[3] //... set_pev(id, pev_punchangle, fAngle)

If I remember correctly, then fAngle should be measured with respect to the player's current angle. So, if you want to punch his view up, for example, just do something like fAngle[0] = 60.0. You need to test this, because sometimes a positive angle means down, sometimes a positive angle means up.
__________________

Last edited by stupok; 06-01-2009 at 01:49.
stupok is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-31-2009 , 23:49   Re: Damage Angle
Reply With Quote #4

Quote:
Originally Posted by stupok View Post
Engine:


Code:
</p><p>new Float:fAngle[3]</p><p>//...</p><p>entity_set_vector(id, EV_VEC_punchangle, fAngle)</p><p>



FakeMeta:


Code:
</p><p>new Float:fAngle[3]</p><p>//...</p><p>set_pev(id, pev_punchangle, fAngle)</p><p>

I don't understand this part:

Code:
//...
can you provide me a plugin ?
Mr.Noobie is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-31-2009 , 23:50   Re: Damage Angle
Reply With Quote #5

That means you put whatever code you want/need there. Have fun and do what ever you want. You need to at least determine what the angle will be and set it to that vector.
__________________
fysiks is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 05-31-2009 , 23:50   Re: Damage Angle
Reply With Quote #6

That's a comment.

When you declare a variable, it defaults to 0. So, you should fill the variable with some angles before you set the punchangle.

EDIT: lol fysiks, we're double-posting
__________________
stupok is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-31-2009 , 23:55   Re: Damage Angle
Reply With Quote #7

Quote:
Originally Posted by stupok View Post
EDIT: lol fysiks, we're double-posting
Yeah, but you are more informative .
__________________
fysiks is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 06-01-2009 , 00:12   Re: Damage Angle
Reply With Quote #8

I still don't understand

Can someone provide me a plugin with the codes ?
Mr.Noobie is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 06-01-2009 , 00:20   Re: Damage Angle
Reply With Quote #9

Code:
/* Script generated by Pawn Studio */ #include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> #define PLUGIN  "New Plugin" #define AUTHOR  "Unknown" #define VERSION "1.0" // to hold the max number of slots in the server new g_iMaxPlayers public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         // register an event     // for entities with classname "player"     // call event_TakeDamage() when the event happens     // call it AFTER (Post=1) the event happens     RegisterHam(Ham_TakeDamage, "player", "event_TakeDamage", 1)         // store the number of slots in the server (maximum is 32 slots)     g_iMaxPlayers = get_maxplayers() } // this is called whenever an entity with classname "player" is damaged public event_TakeDamage(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits) {     // the attacker is a player     if(1 <= iAttacker <= g_iMaxPlayers)     {         // the victim is alive         if(is_user_alive(iVictim))         {             // make a variable to hold angles             new Float:fAngle[3]                         // make some random angles             fAngle[0] = random_float(-90.0, 90.0)             fAngle[1] = random_float(-90.0, 90.0)             fAngle[2] = random_float(-90.0, 90.0)                         // punch the victim's angles             set_pev(iVictim, pev_punchangle, fAngle)         }     }         // don't change any parameters in the original call     return HAM_IGNORED }
__________________
stupok is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-01-2009 , 00:42   Re: Damage Angle
Reply With Quote #10

And, I think the angles are pitch, yaw, and roll respectively.

Stupok, I'm surprised you haven't plugged your thread yet http://forums.alliedmods.net/showthread.php?t=91474
__________________

Last edited by fysiks; 06-01-2009 at 00:49.
fysiks 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 13:57.


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