Raised This Month: $ Target: $400
 0% 

CodeSnippet : Aiming @ Entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lord of Destruction
Member
Join Date: Sep 2004
Old 09-07-2004 , 20:24   CodeSnippet : Aiming @ Entities
Reply With Quote #1

First of all I don't need scripting help, I want to provide something helpfull.

I developed and coded a function that allows Small Scripters to set the aiming of a Player to another one or an Object in the world in actualy any HL MOD.
Testet on Earth's Special Forces and The Specialists.
If you are not familiar with amx scripting just close this topic.

And yes it is absolutly possible to write a Aimbot with it.
I did it, with autosho... but it only works "nice" if you are a listenserver.

So this Function can be used for focusing weapons on ground, next enemy ermmm... etc.

I released this Function, because I think it can't be missused on dedicated Servers.
>> ServerFrames are to low
>> the TimeDelay( Ping depending ) between Aimset and a FireCommand allows no accuratly shooting // yes I tested it ^^

The Function should actualy be clear how it works.

With Admin / MoD permission I may release the rest of my AimingDaemon


>> Update v2 untested but should work ^^

Code:
/** *    (c)        core | Lord of Destruction        2004 * *        >> <a href="mailto:[email protected]">[email protected]</a> * *   CoreID          =   Index of Player/Entity  << Yes, you can adjust Entitys with it *   TargetID        =   Index of Player/Entity * *   I'm not 100% sure with the prechars * *   AimOffset[0]    =   Adds an AimOffset in Degree to horizontal Aim   ( right = - | left = + ) *   AimOffset[1]    =   Adds an AimOffset in Degree to vertical Aim     (    up = - | down = + ) * *   TargetOffset[0] =   Adds a TargetOffset in Units on X-Axis          ( right = + | left = - ) *   TargetOffset[1] =   Adds a TargetOffset in Units on Y-Axis          ( front = + | back = - ) *   TargetOffset[2] =   Adds a TargetOffset in Units on Z-Axis          (    up = + | down = - ) * *   With TargetOffset you can describe points on/around the Target *       for example the nose of a player should be { 0.0, 5.0, 15.0 } << I know I'm evil */ #include <amxmodx> #include <engine> #define inline stock #define x 0 #define y 1 #define z 2 inline Float:Distance2D( Float:X, Float:Y )     return floatsqroot( (X*X) + (Y*Y) ); inline Float:Distance3D( Float:X, Float:Y, Float:Z  )     return floatsqroot( (X*X) + (Y*Y) + (Z*Z) ); inline Float:Degree2Radian( Float:Degree )     return Degree / 360.0 * ( 2 * 3.141592653589793 ); inline Float:Radian2Degree( Float:Radian )     return Radian * 360.0 / ( 2 * 3.141592653589793 ); setClientAIMING( CoreID, TargetID, Float:AimOffset[2] = { 0.0, 0.0 }, Float:TargetOffset[3] = { 0.0, 0.0, 0.0 } ) {     new Float:CoreAngles[3] = { 0.0, 0.0, 0.0 };     new Float:CoreOrigin[3];     entity_get_vector( CoreID, EV_VEC_origin, CoreOrigin );     new Float:TargetOrigin[3];     entity_get_vector( TargetID, EV_VEC_origin, TargetOrigin );     // >> [ TargetOrigin Modifieres ]     new Float:TargetAngles[3];     entity_get_vector( TargetID, EV_VEC_angles, TargetAngles );     // >> [ should work ^^ ]     new anglemode:Mode = degrees;     TargetOrigin[x] += TargetOffset[x] * floatsin( TargetAngles[y], Mode );     TargetOrigin[y] += TargetOffset[y] * floatcos( TargetAngles[y], Mode );     TargetOrigin[z] += TargetOffset[z];     // >> [ calculate Delta ]     new Float:DeltaOrigin[3];     for ( new i = 0; i < 3; i++ )         DeltaOrigin[i] = CoreOrigin[i] - TargetOrigin[i];     // >> [ calculate Vertical-AIM ]     CoreAngles[x] = Radian2Degree( floatatan( DeltaOrigin[z] / Distance2D( DeltaOrigin[x], DeltaOrigin[y] ), 0 ) );     CoreAngles[x] += AimOffset[y];     // >> [ calculate Horizontal-AIM }     CoreAngles[y] = Radian2Degree( floatatan( DeltaOrigin[y] / DeltaOrigin[x], 0 ) ) + AimOffset[x];     CoreAngles[y] += AimOffset[x];     ( DeltaOrigin[x] >= 0.0 ) ? ( CoreAngles[y] += 180.0 )/* Q1 & Q2 */ : ( CoreAngles[y] += 0.0 )/* Q3 & Q4 */;     // >> [ set AimVector ]     entity_set_vector( CoreID, EV_VEC_angles, CoreAngles );     entity_set_int( CoreID, EV_INT_fixangle, 1 );     return 1; }
Lord of Destruction is offline
Blunted1
Senior Member
Join Date: Jun 2004
Old 09-10-2004 , 22:11  
Reply With Quote #2

Quote:
With Admin / MoD permission I may release the rest of my AimingDaemon
I would like to see this script, please send it via PM if you don't mind.
Thanks
Blunted1 is offline
WDUK
Senior Member
Join Date: Aug 2004
Location: Great Britain
Old 09-10-2004 , 22:14  
Reply With Quote #3

Sounds interesting, i'd give it a go
__________________
R.E.M Gig 2005
Done by VH2
Lancashire Cricket Ground
I'm There!
WDUK is offline
Send a message via MSN to WDUK
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 09-10-2004 , 22:22  
Reply With Quote #4

heh, ur good enough to write a hack
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
WDUK
Senior Member
Join Date: Aug 2004
Location: Great Britain
Old 09-10-2004 , 22:25  
Reply With Quote #5

Thats an achevement, well done
__________________
R.E.M Gig 2005
Done by VH2
Lancashire Cricket Ground
I'm There!
WDUK is offline
Send a message via MSN to WDUK
Blunted1
Senior Member
Join Date: Jun 2004
Old 09-10-2004 , 22:35  
Reply With Quote #6

Quote:
Originally Posted by johnjg75
heh, ur good enough to write a hack
And you are good enough to... ?

Actually what is written above you is called a Function, not a plugin.
And by definition cannot be considered a hack.
Had you spent twenty seconds (and actually had the know how) you may realize this function does nothing more than adjust your aim.... it does not in anyway act as an aimbot.... mainly because no function alone ever could.

Maybe not the most usefull function to most with limited imaginations, and maybe it would be a hack if someone with as limited of an imagination as you were to come by and make it that, but it is still just a function..... not a hack.

Lastly, it does not even have the potential to ever be a hack as written above... but we wouldnt count on people in a forum to read before accuseing people of hacking would we? no that would be downright intelligent.

Quote:
I released this Function, because I think it can't be missused on dedicated Servers.
>> ServerFrames are to low
>> the TimeDelay( Ping depending ) between Aimset and a FireCommand allows no accuratly shooting // yes I tested it ^^
Blunted1 is offline
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 09-10-2004 , 23:28  
Reply With Quote #7

dude i was just playin around..
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 09-11-2004 , 22:07  
Reply With Quote #8

This could be veeeery helpfull in one of my plugins, But could you be son kind as to provide a example on how to use the functions ?
EKS is offline
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 09-11-2004 , 23:21  
Reply With Quote #9

which, MoveEnts?
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
Anpheus
Senior Member
Join Date: Aug 2004
Old 09-12-2004 , 00:08  
Reply With Quote #10

To make the aiming angle dependent, simply make it so that when you do the "Float:AimOffset[3]" make it only two variables.

See, the angle vector for an entity is, like you typed, two floats.


So simply pass +/- longitude +/- latitude. Add that number to the 'h-aim' and 'v-aim'

Since h-aim and v-aim are vectors that represent points on a sphere, adding or subtracting changes the angle.
Anpheus 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 17:17.


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