Destroy Object Node GPS?
#1

Heey all,

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.
Example;
Код:
-//Arrows that i need to follow to go to my location
-//Arrows that i need to follow to go to my location
-//Arrows that i need to follow to go to my location
^//my car is driving to the arrows
x//I passed this arrows so i need to delete those
x//I passed this arrows so i need to delete those
x//I passed this arrows so i need to delete those
x//I passed this arrows so i need to delete those
The Code for creating the arrows:
Код:
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;
}
How can i destroy the passed arrows?

Thanks Admigo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)