SA-MP Forums Archive
Destroy Object Node GPS? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Destroy Object Node GPS? (/showthread.php?tid=341147)



Destroy Object Node GPS? - Admigo - 09.05.2012

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