AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Damage Angle (https://forums.alliedmods.net/showthread.php?t=93693)

Mr.Noobie 05-31-2009 23:22

Damage Angle
 
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.

fysiks 05-31-2009 23:25

Re: Damage Angle
 
I believe that is called "punchangle"

stupok 05-31-2009 23:46

Re: Damage Angle
 
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.

Mr.Noobie 05-31-2009 23:49

Re: Damage Angle
 
Quote:

Originally Posted by stupok (Post 839278)
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 ?

fysiks 05-31-2009 23:50

Re: Damage Angle
 
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.

stupok 05-31-2009 23:50

Re: Damage Angle
 
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

fysiks 05-31-2009 23:55

Re: Damage Angle
 
Quote:

Originally Posted by stupok (Post 839282)
EDIT: lol fysiks, we're double-posting

Yeah, but you are more informative :).

Mr.Noobie 06-01-2009 00:12

Re: Damage Angle
 
I still don't understand :cry:

Can someone provide me a plugin with the codes ?

stupok 06-01-2009 00:20

Re: Damage Angle
 
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 }

fysiks 06-01-2009 00:42

Re: Damage Angle
 
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


All times are GMT -4. The time now is 13:57.

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