Raised This Month: $ Target: $400
 0% 

PushBack plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sting1978
New Member
Join Date: Apr 2012
Old 04-27-2012 , 08:48   PushBack plugin
Reply With Quote #1

Hi, I am kinda new here.

I am working on a ECX addon called ECX: World of Destiny.
One of our goals is creating new plugins for ESF/ECX.

Now I am busy try to create a new plugin called pushback.
What it should do is when someone is near you that you can charge up and when charge is @100% he will do this pushback.

The charge and all seems good but the function doing the pushback doesnt work and tryed many things to make it work but then seems to have errors.
And maybe someone is able to help me out with this one.

What it should do exactly is when someone is near like arround 500 units or less the pushback has effect on the target.

Here is my code of the pushback part and hope someone is able to help me out.

Code:
 
public Push (Client)
{
 if( vector_distance( PlayerOrigin, TargetOrigin ) <= 500.0 )
 {
  entity_get_vector( Client, EV_VEC_velocity, PlayerOrigin );
 
  for( new Target = 1; Target <=32; Target++ )
  {
   entity_get_vector( Target, EV_VEC_velocity, TargetOrigin );
 
   if( getClientPL( Target ) < getClientPL( Client ))
   {
    for ( new i = 0; i < 3; i++ )
     Velocity[i] = ( PlayerOrigin[i] - TargetOrigin[i] ) / ( vector_distance( PlayerOrigin, TargetOrigin ) *5000 );
 
    entity_set_vector( Target, EV_VEC_velocity, Velocity );
   }
  }
 }
}
Sting1978 is offline
Old 04-28-2012, 15:06
Sting1978
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
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 07:51.


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