Wysłany: 2014-06-25, 20:02
mrmas
Wiek: 27 Na forum: 4811 dni Posty: 54
Nick w MP: Michalphs
Piwa : 584
Siemka edytuje sobie licznik driftu, lecz na pocz?tku s? errory. Za pomoc Browar
Error:
Kod:
error 001: expected token: "-identifier-", but found "-string-"
error 035: argument type mismatch (argument 4)
error 035: argument type mismatch (argument 4)
error 006: must be assigned to an array
error 001: expected token: "-identifier-", but found "-string-"
error 035: argument type mismatch (argument 4)
KOD:
Pawn
forward AngleUpdate ();
public AngleUpdate ()
{
for(new g = 0 ; g < 200 ; g ++)
{
new Float : x , Float : y , Float : z ;
if( IsPlayerInAnyVehicle ( g )) GetVehiclePos ( GetPlayerVehicleID ( g ), x , y , z ); else GetPlayerPos ( g , x , y , z );
ppos [ g ][ 0 ] = x ;
ppos [ g ][ 1 ] = y ;
ppos [ g ][ 2 ] = z ;
}
}
Float : GetPlayerTheoreticAngle ( i )
{
new Float : sin ;
new Float : dis ;
new Float : angle2 ;
new Float : x , Float : y , Float : z ;
new Float : tmp3 ;
new Float : tmp4 ;
new Float : MindAngle ;
if( IsPlayerConnected ( i )){
GetPlayerPos ( i , x , y , z );
dis = floatsqroot ( floatpower ( floatabs ( floatsub ( x , ppos [ i ][ 0 ])), 2 )+ floatpower ( floatabs ( floatsub ( y , ppos [ i ][ 1 ])), 2 ));
if( IsPlayerInAnyVehicle ( i )) GetVehicleZAngle ( GetPlayerVehicleID ( i ), angle2 ); else GetPlayerFacingAngle ( i , angle2 );
if( x > ppos [ i ][ 0 ]){ tmp3 = x - ppos [ i ][ 0 ];}else{ tmp3 = ppos [ i ][ 0 ]- x ;}
if( y > ppos [ i ][ 1 ]){ tmp4 = y - ppos [ i ][ 1 ];}else{ tmp4 = ppos [ i ][ 1 ]- y ;}
if( ppos [ i ][ 1 ]> y && ppos [ i ][ 0 ]> x ){ //1
sin = asin ( tmp3 / dis );
MindAngle = floatsub ( floatsub ( floatadd ( sin , 90 ), floatmul ( sin , 2 )), - 90.0 );
}
if( ppos [ i ][ 1 ]< y && ppos [ i ][ 0 ]> x ){ //2
sin = asin ( tmp3 / dis );
MindAngle = floatsub ( floatadd ( sin , 180 ), 180.0 );
}
if( ppos [ i ][ 1 ]< y && ppos [ i ][ 0 ]< x ){ //3
sin = acos ( tmp4 / dis );
MindAngle = floatsub ( floatadd ( sin , 360 ), floatmul ( sin , 2 ));
}
if( ppos [ i ][ 1 ]> y && ppos [ i ][ 0 ]< x ){ //4
sin = asin ( tmp3 / dis );
MindAngle = floatadd ( sin , 180 );
}
}
if( MindAngle == 0.0 ){
return angle2 ;
} else
Wysłany: 2014-06-25, 20:32
JotP
Wiek: 26 Na forum: 4821 dni Posty: 217
Piwa : 1215
A podasz dok?adne linijki? Nie chc? mi si? szukac.
Wysłany: 2014-06-25, 20:39
mrmas
Wiek: 27 Na forum: 4811 dni Posty: 54
Nick w MP: Michalphs
Piwa : 584
Pawn
new Float : x , Float : y , Float : z ; - error 001 : expected token : "-identifier-" , but found "-string-"
if( IsPlayerInAnyVehicle ( g )) GetVehiclePos ( GetPlayerVehicleID ( g ), x , y , z ); else GetPlayerPos ( g , x , y , z ); - error 035 : argument type mismatch ( argument 4 )
ppos [ g ][ 2 ] = z ; - error 006 : must be assigned to an array
//Float:GetPlayerTheoreticAngle(i)
new Float : x , Float : y , Float : z ; - error 001 : expected token : "-identifier-" , but found "-string-"
GetPlayerPos ( i , x , y , z ); - GetPlayerPos ( i , x , y , z );
Tagi: licznik :: drift
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: