SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/05/2012, 06:49 PM   #1
Admigo
High-roller
 
Admigo's Avatar
 
Join Date: Oct 2010
Location: The Netherlands
Posts: 1,840
Reputation: 297
Default Destroy Object Node GPS?

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;
Code:
-//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:
Code:
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
__________________
Follow me on Instagram @brandonvanommen
Admigo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Destroy Object help Gooday Scripting Help 4 14/03/2012 02:15 PM
Can't get object to destroy austin070 Scripting Help 6 19/10/2011 12:36 AM
Destroy Object when player surfing in object kurta999 Bug Reports 0 06/01/2011 03:08 PM
destroy object 02manchestera Help Archive 7 28/03/2010 01:31 PM
Destroy an object Danut Help Archive 5 07/03/2009 10:29 PM


All times are GMT. The time now is 11:31 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.