AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get angle of ground user is standing on (https://forums.alliedmods.net/showthread.php?t=118329)

Max! 02-09-2010 23:38

Get angle of ground user is standing on
 
The plugin im coding makes jumppads that shoots a user in the direction based on the angle of the jumppad, but the code i tried to use from nomexuoisoajusds lie flat plugin wouldnt work.
the basic setup is this:
_______ <-- AAATRIGGER assigned to a trigger_multiple
_______ <-- ground

when user steps on the AAATRIGGER, it registers in touch, and this is where i need the angle of the ground

thanks for the help in advance :D

Exolent[jNr] 02-10-2010 00:29

Re: Get angle of ground user is standing on
 
Code:
new Float:vStart[ 3 ]; pev( iPlayer, pev_origin, vStart ); new Float:vStop[ 3 ]; pev( iPlayer, pev_mins, vStop ); vStop[ 0 ] = vStop[ 1 ] = 0.0; xs_vec_add( vStart, vStop, vStop ); vStop[ 2 ] -= 80.0; // 80 units below player's feet engfunc( EngFunc_TraceLine, vStart, vStop, 0, iPlayer, 0 ); new Float:fFraction; get_tr2( 0, TR_flFraction, fFraction ); if( fFraction != 1.0 ) {     new Float:vPlaneNormal[ 3 ];     get_tr2( 0, TR_vecPlaneNormal, vPlaneNormal );         new Float:vVelocity[ 3 ];     xs_vec_mul_scalar( vPlaneNormal, 500.0, vVelocity ); // 500.0 = speed         set_pev( iPlayer, pev_velocity, vVelocity ); }

Max! 02-10-2010 00:40

Re: Get angle of ground user is standing on
 
wow man you rock it works perfectly

if there was still karma here, youd be up to your neck in it


All times are GMT -4. The time now is 07:16.

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