SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 01/12/2014, 03:44 PM   #1
daggerkinq
Little Clucker
 
Join Date: May 2014
Posts: 6
Reputation: 0
Question Attach Object To Vehicle Destroy Object Problem

Hello, I have A Question my Car was supposed to Be the Object I'm Adding Another Car And When I Got the first Arabaki second Objects Coming into the Car, So it doesn't Erase Objects, I Wonder How do I Delete the Objects ?

Code:
new Fire[MAX_PLAYERS][13];
new Ex[MAX_PLAYERS][8];
new M2m[MAX_PLAYERS][6];

COMMAND:m1(playerid, params[])
{
if(Araba[playerid] == 1)  DestroyVehicleEx(ivehicle[playerid]), Araba[playerid] = 0;
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
ivehicle[playerid] = CreateVehicle(562,X,Y,Z,Angle,0,0,0);
PutPlayerInVehicle(playerid,ivehicle[playerid],0);

Ex[playerid][0] = CreateObject(1018,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Ex[playerid][0], GetPlayerVehicleID(playerid), 0.089999,1.275000,-0.505000,-123.119987,-1.620000,-270.719848);
Ex[playerid][1] = CreateObject(1018,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Ex[playerid][1], GetPlayerVehicleID(playerid), 0.089999,1.564999,-0.505000,-123.119987,-1.620000,-270.719848);
Ex[playerid][2] = CreateObject(1018,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Ex[playerid][2], GetPlayerVehicleID(playerid), 0.059999,1.854999,-0.505000,-123.119987,-1.620000,-270.719848);
Ex[playerid][3] = CreateObject(1018,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Ex[playerid][3], GetPlayerVehicleID(playerid), 0.059999,1.854999,-0.505000,-123.119987,-1.620000,-270.719848);
Ex[playerid][4] = CreateObject(1018,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Ex[playerid][4], GetPlayerVehicleID(playerid), -0.045000,1.854999,-0.505000,-123.119987,3.779998,-88.020568);
Ex[playerid][5] = CreateObject(1018,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Ex[playerid][5], GetPlayerVehicleID(playerid), -0.075000,1.529999,-0.505000,-123.119987,9.540000,-83.700561);
Ex[playerid][6] = CreateObject(1018,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Ex[playerid][6], GetPlayerVehicleID(playerid), -0.095000,1.275000,-0.505000,-123.119987,-1.620000,-451.260925);
Ex[playerid][7] = CreateObject( 1001,0,0,0,0,0,0,80 );
AttachObjectToVehicle(Ex[playerid][7], GetPlayerVehicleID(playerid), -0.000000, -2.100000, 0.299999, 0.000000, 0.000000, 0.000000 );
Fire[playerid][0] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][0], GetPlayerVehicleID(playerid), -0.520000,1.205000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][1] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][1], GetPlayerVehicleID(playerid), -0.520000,1.365000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][2] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][2], GetPlayerVehicleID(playerid), -0.520000,1.505000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][3] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][3], GetPlayerVehicleID(playerid), -0.520000,1.665000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][4] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][4], GetPlayerVehicleID(playerid), -0.520000,1.205000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][5] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][5], GetPlayerVehicleID(playerid), -0.599999,1.800000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][6] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][6], GetPlayerVehicleID(playerid), -0.599999,1.950000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][7] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][7], GetPlayerVehicleID(playerid), 0.559999,1.950000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][8] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][8], GetPlayerVehicleID(playerid), 0.559999,1.790000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][9] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][9], GetPlayerVehicleID(playerid), 0.539999,1.660000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][10] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][10], GetPlayerVehicleID(playerid), 0.539999,1.490000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][11] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][11], GetPlayerVehicleID(playerid), 0.539999,1.330000,-1.174999,0.000000,0.000000,0.000000);
Fire[playerid][12] = CreateObject(18693,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Fire[playerid][12], GetPlayerVehicleID(playerid), 0.539999,1.160001,-1.174999,0.000000,0.000000,0.000000);

for(new i;i<6;i++)DestroyObject(M2m[playerid][i]);
DestroyObject(M2m[playerid][0]);
DestroyObject(M2m[playerid][1]);
DestroyObject(M2m[playerid][2]);
DestroyObject(M2m[playerid][3]);
DestroyObject(M2m[playerid][4]);
DestroyObject(M2m[playerid][5]);

AddVehicleComponent(GetPlayerVehicleID(playerid), 1079);
AddVehicleComponent(ivehicle[playerid], 1010);
SetVehicleVirtualWorld(ivehicle[playerid], GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(ivehicle[playerid], GetPlayerInterior(playerid));
Araba[playerid] = 1;
return 1;
}

COMMAND:m2(playerid, params[])
{
if(Araba[playerid] == 1)  DestroyVehicleEx(ivehicle[playerid]), Araba[playerid] = 0;
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
ivehicle[playerid] = CreateVehicle(541,X,Y,Z,Angle,0,0,0);

for(new i;i<13;i++)DestroyObject(Fire[playerid][i]);
for(new i;i<8;i++)DestroyObject(Ex[playerid][i]);
DestroyObject(Fire[playerid][0]);
DestroyObject(Fire[playerid][1]);
DestroyObject(Fire[playerid][2]);
DestroyObject(Fire[playerid][3]);
DestroyObject(Fire[playerid][4]);
DestroyObject(Fire[playerid][5]);
DestroyObject(Fire[playerid][6]);
DestroyObject(Fire[playerid][7]);
DestroyObject(Fire[playerid][8]);
DestroyObject(Fire[playerid][9]);
DestroyObject(Fire[playerid][10]);
DestroyObject(Fire[playerid][11]);
DestroyObject(Fire[playerid][12]);
DestroyObject(Ex[playerid][0]);
DestroyObject(Ex[playerid][1]);
DestroyObject(Ex[playerid][2]);
DestroyObject(Ex[playerid][3]);
DestroyObject(Ex[playerid][4]);
DestroyObject(Ex[playerid][5]);
DestroyObject(Ex[playerid][6]);
DestroyObject(Ex[playerid][7]);
PutPlayerInVehicle(playerid,ivehicle[playerid],0);

M2m[playerid][0] = CreateObject(1023,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(M2m[playerid][0], GetPlayerVehicleID(playerid), 0.000000,-1.950000,0.300000,8.100001,0.000000,0.000000);
M2m[playerid][1] = CreateObject(362,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(M2m[playerid][1], GetPlayerVehicleID(playerid), -0.150000,-0.824999,0.749999,-89.099983,-62.100009,0.000000);
M2m[playerid][2] = CreateObject(1318,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(M2m[playerid][2], GetPlayerVehicleID(playerid), -0.974999,0.000000,-0.150000,89.099983,0.000000,0.000000);
M2m[playerid][3] = CreateObject(1318,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(M2m[playerid][3], GetPlayerVehicleID(playerid), 0.974999,0.000000,-0.150000,89.099983,0.000000,0.000000);
M2m[playerid][4] = CreateObject(18650,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(M2m[playerid][4], GetPlayerVehicleID(playerid), -0.974999,0.000000,-0.449999,0.000000,0.000000,0.000000);
M2m[playerid][5] = CreateObject(18649,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(M2m[playerid][5], GetPlayerVehicleID(playerid), 0.974999,0.000000,-0.449999,0.000000,0.000000,0.000000);

AddVehicleComponent(GetPlayerVehicleID(playerid), 1079);
AddVehicleComponent(ivehicle[playerid], 1010);
SetVehicleVirtualWorld(ivehicle[playerid], GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(ivehicle[playerid], GetPlayerInterior(playerid));
Araba[playerid] = 1;
return 1;
}

Last edited by daggerkinq; 06/12/2014 at 06:03 PM.
daggerkinq is offline   Reply With Quote
Old 06/12/2014, 06:03 PM   #2
daggerkinq
Little Clucker
 
Join Date: May 2014
Posts: 6
Reputation: 0
Default Re: Attach Object To Vehicle Destroy Object Problem

Help !
daggerkinq 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
[FilterScript] Attach Object To Object Tool by Zero_Cool 2013 zero_cool Filterscripts 10 28/05/2014 05:56 AM
Player object attach problem supergirlpenetrator Scripting Help 5 31/07/2013 11:29 AM
Object Don't destroy and sometime don't even attach -CaRRoT Scripting Help 5 30/08/2011 11:52 AM
Problem with attach object. Vvolk Help Archive 2 20/04/2011 11:57 AM
Destroy Object when player surfing in object kurta999 Bug Reports 0 06/01/2011 03:08 PM


All times are GMT. The time now is 12:33 AM.


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