Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Action:HolyShit(client, args)
- {
- /*new Float:fClientOrigin[3];
- new Float:fClientViewAngle[3];
- new Float:fEndPosition[3];
- TR_TraceRayFilter(fClientOrigin, fClientViewAngle, MASK_SOLID, RayType_Infinite, TraceRayDontHitSelf, client);
- if( TR_DidHit() )
- {
- new Float:height;
- new Float:factor;
- TR_GetEndPosition( fEndPosition );
- GetClientAbsOrigin(client, fClientOrigin);
- GetClientEyeAngles(client, fClientViewAngle);
- if( fEndPosition[2] > fClientOrigin[2] )
- height = float( (GetClientButtons(client) & IN_DUCK) ? fEndPosition[2] + PLAYER_HEIGHT : fEndPosition[2] + DPLAYER_HEIGHT );
- else
- return Plugin_Handled;
- factor = GetFactor( height, 0.02 );
- if( GetVectorDistance( fClientOrigin, fEndPosition ) < 40 && (fEndPosition[2] <= fClientOrigin[3] || 0 < TR_GetEntityIndex() <= 64) )
- {
- for( float i = i; i < SquareRoot(height); i += SquareRoot(height) / factor )
- {
- float X = i * Cosine( fClientViewAngle[1] ) + fClientOrigin[0];
- float Y = i * Sine( fClientViewAngle[1] ) + fClientOrigin[1];
- float Z = ( fClientOrigin[0] - fEndPosition[0] / Cosine( fClientViewAngle[1] ) ) * i;
- }
- }
- }
- */
- new Float:fClientOrigin[3];
- new Float:fClientViewAngle[3];
- new Float:fEndPosition[3];
- new Float:fClientEyesOrigin[3];
- new Float:fPlayerJetPos = float( (GetClientButtons(client) & IN_DUCK) ? DPLAYER_HEIGHT : PLAYER_HEIGHT );
- GetClientEyePosition(client, fClientEyesOrigin);
- GetClientAbsOrigin(client, fClientOrigin);
- GetClientEyeAngles(client, fClientViewAngle);
- fClientOrigin[2] += fPlayerJetPos;
- TR_TraceRayFilterEx(fClientEyesOrigin, fClientViewAngle, MASK_SOLID, RayType_Infinite, TraceRayDontHitSelf, client);
- TR_GetEndPosition( fEndPosition );
- if( TR_DidHit() )
- {
- new Float:fJetBreakPoint[3];
- if( GetVectorDistance( fClientOrigin, fEndPosition ) > STRONG_JET_LEN )
- {
- new Float: fFactor = FloatAbs( Sine( DegToRad(fClientViewAngle[0] + 89.0) ) );
- new Float: fPitch, Float: fVec1, Float: fVec2, Float: fNewAngles[3];
- fJetBreakPoint[0] = fClientEyesOrigin[0] + STRONG_JET_LEN * fFactor * Cosine( DegToRad(fClientViewAngle[1]) );
- fJetBreakPoint[1] = fClientEyesOrigin[1] + STRONG_JET_LEN * fFactor * Sine( DegToRad(fClientViewAngle[1]) );
- fJetBreakPoint[2] = fClientEyesOrigin[2] - STRONG_JET_LEN * fFactor * Sine( DegToRad(fClientViewAngle[0]) );
- fVec1[0] = fJetBreakPoint[0] - fClientOrigin[0];
- fVec1[1] = fJetBreakPoint[1] - fClientOrigin[1];
- fVec1[2] = fJetBreakPoint[2] - fClientOrigin[2];
- fVec2[0] = fClientEyesOrigin[0] - fClientOrigin[0];
- fVec2[1] = fClientEyesOrigin[1] - fClientOrigin[1];
- fVec2[2] = fClientEyesOrigin[2] - fClientOrigin[2] - fPlayerJetPos;
- fPitch = ArcCosine( (fVec1[0] * fVec2[0] + fVec1[1] * fVec2[1] + fVec1[2] * fVec2[2]) / GetVectorLength( fVec1 ) * GetVectorLength( fVec2 ));
- fNewAngles[0] = fPitch; fNewAngles[1] = fClientViewAngle[1]; fNewAngles[2] = 0.0;
- TR_TraceRayFilterEx(fJetBreakPoint, fNewAngles, MASK_SOLID, RayType_Infinite);
- if( TR_DidHit() )
- {
- new Float: fLastPoint[3];
- TR_GetEndPosition(fLastPoint);
- TE_SetupBeamPoints( fClientOrigin, fJetBreakPoint, g_iModelIndex, 0, 0, 0, PISS_TIME, 10.0, 10.0, 1, 0.0, g_iColor, 0 );
- TE_SendToClient( client );
- TE_SetupBeamPoints( fJetBreakPoint, fLastPoint, g_iModelIndex, 0, 0, 0, PISS_TIME, 10.0, 10.0, 1, 0.0, g_iColor, 0 );
- TE_SendToClient( client );
- }
- }
- else
- {
- TE_SetupBeamPoints( fClientOrigin, fEndPosition, g_iModelIndex, 0, 0, 0, PISS_TIME, 10.0, 10.0, 1, 0.0, g_iColor, 0 );
- TE_SendToClient( client );
- }
- //SetEntityMoveType( client, MOVETYPE_NONE );
- //CreateTimer( PISS_TIME, UnfreezeClient, client );
- }
- else
- {
- PrintToChatAll("WTF?????");
- }
- CloseHandle( hTrace );
- return Plugin_Handled;
- }
Add Comment
Please, Sign In to add comment