I am using RouteConnecter for making a gps system.
I made a test route but when i drive the wrong way the objects dont destroy.
Код:
public GPS_WhenRouteIsCalculated(routeid,node_id_array[],amount_of_nodes,distance)
{
for(new i = 0; i < amount_of_nodes; ++i)
{
new Float:X,Float:Y,Float:Z,Float:A,Float:Ax,Float:Ay,Float:Az;
GetNodePos(node_id_array[i],X,Y,Z);
if(i < amount_of_nodes-3)
{
GetNodePos(node_id_array[i+3],Ax,Ay,Az);
A =floatabs(270.0 - atan2( Ax-X,Ay-Y));
CreateDynamicObject(1318,X,Y,Z+0.2,0.0,90.0,A);
}else
if(i < amount_of_nodes-2)
{
GetNodePos(node_id_array[i+2],Ax,Ay,Az);
A =floatabs(270.0 - atan2( Ax-X,Ay-Y));
CreateDynamicObject(1318,X,Y,Z+0.2,0.0,90.0,A);
}else
if(i < amount_of_nodes-1)
{
GetNodePos(node_id_array[i+1],Ax,Ay,Az);
A =floatabs(270.0 - atan2( Ax-X,Ay-Y));
CreateDynamicObject(1318,X,Y,Z+0.2,0.0,90.0,A);
}
else
{
CreateDynamicObject(1318,X,Y,Z+0.2,0.0,0.0,0.0);
}
//printf("Point(%d)=NodeID(%d)",i,node_id_array[i]);
}
//Create();
SendClientMessage(routeid,-1,"Happy route!");
return 1;
}