Raised This Month: $ Target: $400
 0% 

problem with EV_INT_fixangle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 09-22-2007 , 07:05   problem with EV_INT_fixangle
Reply With Quote #1

Code:
new Float:angle[3]
entity_get_vector(id,EV_VEC_angles,angle)

angle[0] += recoil[0]
angle[1] += recoil[1]

entity_set_vector(id,EV_VEC_angles,angle)
entity_set_int(id,EV_INT_fixangle,3)
this should work, but y axis is allways stuck and changing to 0 repeatedly, do anyone know why? when i comment entity_set_int(id,EV_INT_fixangle,1) setting view angle doesnt work

pls help me
__________________
Voi is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-22-2007 , 07:13   Re: problem with EV_INT_fixangle
Reply With Quote #2

If you want an anti-recoil, see this plugin by VEN.
Attached Files
File Type: sma Get Plugin or Get Source (30_fix_recoil.sma - 1109 views - 2.9 KB)
__________________
Arkshine is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 09-22-2007 , 08:33   Re: problem with EV_INT_fixangle
Reply With Quote #3

no, i want to add an effect of shaking hand while looking to the scope(stalker, call of duty etc.)

i have almost acomplished it, but the y axis stays 0(middle of the screen), and i dont know why, so it moves randomly like it suppose to(axis x and y), but you cant aim up and down(axis y)

i just need it fixed
__________________
Voi is offline
Old 09-22-2007, 09:40
[ --<-@ ] Black Rose
This message has been deleted by [ --<-@ ] Black Rose.
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 09-22-2007 , 09:44   Re: problem with EV_INT_fixangle
Reply With Quote #4

i will try it now, thanks for reply

edit:

nah angles[2] = z axis

still the same problem
__________________

Last edited by Voi; 09-22-2007 at 09:59.
Voi is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 09-22-2007 , 15:45   Re: problem with EV_INT_fixangle
Reply With Quote #5

You were changin X and Y.
but when i looked at this pic i though that it should be Y and Z.
Attached Thumbnails
Click image for larger version

Name:	Angles.jpg
Views:	280
Size:	8.7 KB
ID:	20367  

Last edited by [ --<-@ ] Black Rose; 09-22-2007 at 15:49.
[ --<-@ ] Black Rose is offline
potatis_invalido
BANNED
Join Date: Jul 2007
Location: 0 (world)
Old 09-22-2007 , 18:01   Re: problem with EV_INT_fixangle
Reply With Quote #6

Not tested, but it should work. Notice the change fromentity_get_vector(id,EV_VEC_angle,angle) to entity_get_vector(id,EV_VEC_v_angle,angle)
Code:
 
new Float:angle[3]
entity_get_vector(id,EV_VEC_v_angle,angle)
 
angle[0] += recoil[0]
angle[1] += recoil[1]
if(angle[0] < -88.994750)
{
angle[0] = -88.994750;
}
else if(angle[0] > 88.994750)
{
angle[0] = 88.994750;
}
if(angle[1] > 180.0)
{
angle[1] -= 360.0;
}
else if(angle[1] < -180.0)
{
angle[1] += 360.0;
}
 
entity_set_vector(id,EV_VEC_angles,angle)
entity_set_int(id,EV_INT_fixangle,1)
This function is tested and works GREEEEAT.
Code:
 
public recoil_dod_style(id, Float:recoil, no_punch)
{
 new Float:angles[3];
 pev(id, pev_v_angle, angles);
 
 angles[0] -= random_float(recoil * 1.2, recoil * 0.8);
 if(angles[0] < -88.994750)
 {
  angles[0] = -88.994750;
 }
 else if(angles[0] > 88.994750)
 {
  angles[0] = 88.994750;
 }
 
 angles[1] += random_float(recoil * 0.35, recoil * -0.35);
 if(angles[1] > 180.0)
 {
  angles[1] -= 360.0;
 }
 else if(angles[1] < -180.0)
 {
  angles[1] += 360.0;
 }
 if(no_punch == 1)
 {
  set_pev(id, pev_punchangle, Float:{ 0.0, 0.0, 0.0 });
 }
 set_pev(id, pev_angles, angles);
 set_pev(id, pev_fixangle, 1);
}

Last edited by potatis_invalido; 09-22-2007 at 18:05.
potatis_invalido is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 10-15-2007 , 20:14   Re: problem with EV_INT_fixangle
Reply With Quote #7

set_pev(id, pev_fixangle, 2);

makes adding the angle instead changing it, i try it but it doesnt work

there was a function or something to add an angle to player view but i dont remeber the name
__________________
Voi is offline
potatis_invalido
BANNED
Join Date: Jul 2007
Location: 0 (world)
Old 10-16-2007 , 05:30   Re: problem with EV_INT_fixangle
Reply With Quote #8

Does this do what you want?
Using Engine:
Code:
public add_to_aim(id, Float:up, Float:right)
{
     new Float:angle[3];
     entity_get_vector(id, EV_VEC_v_angle, angle);
     angle[0] -= up;
     angle[1] -= right;
     if(angle[0] < -88.994750)
     {
          angle[0] = -88.994750;
     }
     else if(angle[0] > 88.994750)
     {
          angle[0] = 88.994750;
     }
     if(angle[1] > 180.0)
     {
          angle[1] -= 360.0;
     }
     else if(angle[1] < -180.0)
     {
          angle[1] += 360.0;
     }
 
     entity_set_vector(id, EV_VEC_angles, angle);
     entity_set_int(id, EV_INT_fixangle, 1);
}
Using Fakemeta:
Code:
public add_to_aim(id, Float:up, Float:right)
{
     new Float:angle[3];
     pev(id, pev_v_angle, angle);
     angle[0] -= up;
     angle[1] -= right;
     if(angle[0] < -88.994750)
     {
          angle[0] = -88.994750;
     }
     else if(angle[0] > 88.994750)
     {
          angle[0] = 88.994750;
     }
     if(angle[1] > 180.0)
     {
          angle[1] -= 360.0;
     }
     else if(angle[1] < -180.0)
     {
          angle[1] += 360.0;
     }
 
     set_pev(id, pev_angles, angle)
     set_pev(id, pev_fixangle, 1);
}

Last edited by potatis_invalido; 10-17-2007 at 15:01.
potatis_invalido is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 10-17-2007 , 11:55   Re: problem with EV_INT_fixangle
Reply With Quote #9

not exacly couse when i call this every second, player isnt able to move the rifle

pls test it yourself

is there a message that adds a vector to player aim ??
__________________
Voi is offline
potatis_invalido
BANNED
Join Date: Jul 2007
Location: 0 (world)
Old 10-17-2007 , 15:04   Re: problem with EV_INT_fixangle
Reply With Quote #10

Tested. It's working fine. You probably need to call it on playerprethink. This is the script I used to test it:
Attached Files
File Type: sma Get Plugin or Get Source (aim.sma - 977 views - 684 Bytes)

Last edited by potatis_invalido; 10-17-2007 at 15:08.
potatis_invalido 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 16:06.


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