Raised This Month: $ Target: $400
 0% 

2 questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
daniel46
Senior Member
Join Date: Dec 2011
Old 06-04-2014 , 15:08   2 questions
Reply With Quote #1

i have a spray high code but some times it will just show 000000000000

Code:
public EventSpray ( )  
{  
	new iPlayer = read_data( 2 );
	if( !SprayContest || AlreadySprayed[ iPlayer ] )
	{
		return;
	}
	new iOrigin[ 3 ];  
	iOrigin[ 0 ] = read_data( 3 );  
	iOrigin[ 1 ] = read_data( 4 );  
	iOrigin[ 2 ] = read_data( 5 );  
	
	new Float:vecOrigin[ 3 ];  
	IVecFVec( iOrigin, vecOrigin );  
	
	new Float:vecDirection[ 3 ];  
	velocity_by_aim( iPlayer, 5, vecDirection );  
	
	new Float:vecStop[ 3 ];  
	xs_vec_add( vecOrigin, vecDirection, vecStop );  
	
	xs_vec_mul_scalar( vecDirection, -1.0, vecDirection );  
	
	new Float:vecStart[ 3 ];  
	xs_vec_add( vecOrigin, vecDirection, vecStart );  
	
	engfunc( EngFunc_TraceLine, vecStart, vecStop, IGNORE_MONSTERS, -1, 0 );  
	
	get_tr2( 0, TR_vecPlaneNormal, vecDirection );  
	
	vecDirection[ 2 ] = 0.0;  
	
	xs_vec_normalize( vecDirection, vecDirection );  
	
	xs_vec_mul_scalar( vecDirection, 5.0, vecDirection );  
	
	xs_vec_add( vecOrigin, vecDirection, vecStart );  
	
	xs_vec_copy( vecStart, vecStop );  
	vecStop[ 2 ] -= 9999.0;  
	
	engfunc( EngFunc_TraceLine, vecStart, vecStop, IGNORE_MONSTERS, -1, 0 );  
	
	get_tr2( 0, TR_vecEndPos, vecStop );  
	
	new Float:FinalMeters;
	
	FinalMeters = (vecStart[ 2 ] - vecStop[ 2 ]) * 0.0254;
	
	SprayContestMeters[ iPlayer] = FinalMeters;
	
	AlreadySprayed[ iPlayer ] = true;
	
	ColorChat( 0 , "^3%s ^1Sprayed ^4%f ^1Meters from the ground" , UserName( iPlayer ) , FinalMeters )
}
and also how can i check if player using any button and if he is what button
daniel46 is offline
 



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 09:44.


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