Guest User

Untitled

a guest
Apr 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.86 KB | None | 0 0
  1. public Action:HolyShit(client, args)
  2. {
  3.     /*new Float:fClientOrigin[3];
  4.     new Float:fClientViewAngle[3];
  5.     new Float:fEndPosition[3];
  6.    
  7.     TR_TraceRayFilter(fClientOrigin, fClientViewAngle, MASK_SOLID, RayType_Infinite, TraceRayDontHitSelf, client);
  8.    
  9.     if( TR_DidHit() )
  10.     {
  11.         new Float:height;
  12.         new Float:factor;
  13.    
  14.         TR_GetEndPosition( fEndPosition );
  15.    
  16.         GetClientAbsOrigin(client, fClientOrigin);
  17.         GetClientEyeAngles(client, fClientViewAngle);
  18.        
  19.         if( fEndPosition[2] > fClientOrigin[2] )
  20.             height = float( (GetClientButtons(client) & IN_DUCK) ? fEndPosition[2] + PLAYER_HEIGHT : fEndPosition[2] + DPLAYER_HEIGHT );
  21.         else
  22.             return Plugin_Handled;
  23.        
  24.         factor = GetFactor( height, 0.02 );
  25.        
  26.         if( GetVectorDistance( fClientOrigin, fEndPosition ) < 40 && (fEndPosition[2] <= fClientOrigin[3] || 0 < TR_GetEntityIndex() <= 64) )
  27.         {
  28.             for( float i = i; i < SquareRoot(height); i += SquareRoot(height) / factor )
  29.             {
  30.                 float X = i * Cosine( fClientViewAngle[1] ) + fClientOrigin[0];
  31.                 float Y = i * Sine( fClientViewAngle[1] ) + fClientOrigin[1];
  32.                 float Z = ( fClientOrigin[0] - fEndPosition[0] / Cosine( fClientViewAngle[1] ) ) * i;
  33.             }
  34.         }
  35.     }
  36.     */
  37.    
  38.     new Float:fClientOrigin[3];
  39.     new Float:fClientViewAngle[3];
  40.     new Float:fEndPosition[3];
  41.     new Float:fClientEyesOrigin[3];
  42.    
  43.     new Float:fPlayerJetPos = float( (GetClientButtons(client) & IN_DUCK) ? DPLAYER_HEIGHT : PLAYER_HEIGHT );
  44.    
  45.     GetClientEyePosition(client, fClientEyesOrigin);
  46.     GetClientAbsOrigin(client, fClientOrigin);
  47.     GetClientEyeAngles(client, fClientViewAngle);
  48.    
  49.     fClientOrigin[2] += fPlayerJetPos;
  50.    
  51.     TR_TraceRayFilterEx(fClientEyesOrigin, fClientViewAngle, MASK_SOLID, RayType_Infinite, TraceRayDontHitSelf, client);
  52.     TR_GetEndPosition( fEndPosition );
  53.    
  54.    
  55.     if( TR_DidHit() )
  56.     {
  57.         new Float:fJetBreakPoint[3];
  58.  
  59.         if( GetVectorDistance( fClientOrigin, fEndPosition ) > STRONG_JET_LEN )
  60.         {  
  61.             new Float: fFactor = FloatAbs( Sine( DegToRad(fClientViewAngle[0] + 89.0) ) );
  62.             new Float: fPitch, Float: fVec1, Float: fVec2, Float: fNewAngles[3];
  63.            
  64.             fJetBreakPoint[0] = fClientEyesOrigin[0] + STRONG_JET_LEN * fFactor * Cosine( DegToRad(fClientViewAngle[1]) );
  65.             fJetBreakPoint[1] = fClientEyesOrigin[1] + STRONG_JET_LEN * fFactor * Sine( DegToRad(fClientViewAngle[1]) );
  66.             fJetBreakPoint[2] = fClientEyesOrigin[2] - STRONG_JET_LEN * fFactor * Sine( DegToRad(fClientViewAngle[0]) );
  67.            
  68.             fVec1[0] = fJetBreakPoint[0] - fClientOrigin[0];
  69.             fVec1[1] = fJetBreakPoint[1] - fClientOrigin[1];
  70.             fVec1[2] = fJetBreakPoint[2] - fClientOrigin[2];
  71.            
  72.             fVec2[0] = fClientEyesOrigin[0] - fClientOrigin[0];
  73.             fVec2[1] = fClientEyesOrigin[1] - fClientOrigin[1];
  74.             fVec2[2] = fClientEyesOrigin[2] - fClientOrigin[2] - fPlayerJetPos;
  75.            
  76.             fPitch = ArcCosine( (fVec1[0] * fVec2[0] + fVec1[1] * fVec2[1] + fVec1[2] * fVec2[2]) / GetVectorLength( fVec1 ) * GetVectorLength( fVec2 ));
  77.            
  78.             fNewAngles[0] = fPitch; fNewAngles[1] = fClientViewAngle[1]; fNewAngles[2] = 0.0;
  79.            
  80.             TR_TraceRayFilterEx(fJetBreakPoint, fNewAngles, MASK_SOLID, RayType_Infinite);
  81.            
  82.             if( TR_DidHit() )
  83.             {
  84.                 new Float: fLastPoint[3];
  85.                 TR_GetEndPosition(fLastPoint);
  86.            
  87.                 TE_SetupBeamPoints( fClientOrigin, fJetBreakPoint, g_iModelIndex, 0, 0, 0, PISS_TIME, 10.0, 10.0, 1, 0.0, g_iColor, 0 );
  88.                 TE_SendToClient( client );
  89.                
  90.                 TE_SetupBeamPoints( fJetBreakPoint, fLastPoint, g_iModelIndex, 0, 0, 0, PISS_TIME, 10.0, 10.0, 1, 0.0, g_iColor, 0 );
  91.                 TE_SendToClient( client );
  92.                
  93.             }
  94.         }
  95.         else
  96.         {
  97.             TE_SetupBeamPoints( fClientOrigin, fEndPosition, g_iModelIndex, 0, 0, 0, PISS_TIME, 10.0, 10.0, 1, 0.0, g_iColor, 0 );
  98.            
  99.             TE_SendToClient( client );
  100.         }
  101.        
  102.        
  103.         //SetEntityMoveType( client, MOVETYPE_NONE );
  104.        
  105.         //CreateTimer( PISS_TIME, UnfreezeClient, client );
  106.     }
  107.     else
  108.     {
  109.         PrintToChatAll("WTF?????");
  110.     }
  111.    
  112.     CloseHandle( hTrace );
  113.    
  114.     return Plugin_Handled;
  115. }
Add Comment
Please, Sign In to add comment