SA-MP Forums Archive
Object refuses to remove itself. - 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: Object refuses to remove itself. (/showthread.php?tid=330949)



Object refuses to remove itself. - iLcke - 03.04.2012

So, I wind up typing this;
pawn Код:
if(UC[VID] == 1)
{
DestroyObject(siren[UC]);
UC[VID] = 0;
return 1;
}
And, it didn't work, has no errors, just didn't work ingame.


Re: Object refuses to remove itself. - Cjgogo - 03.04.2012

Show us where you defined the object Siren


Re: Object refuses to remove itself. - iLcke - 03.04.2012

pawn Код:
new Siren[MAX_VEHICLES];
Used that.


Re: Object refuses to remove itself. - Cjgogo - 03.04.2012

Well,first off all remove the "return 1;" in your code,and secondly,what does UC mean as I see you indexed Siren togheter with UC(siren[UC]),secondly,try Siren[UC],but I think you should try working with Siren[vehicleid],anyway,first try this:

pawn Код:
if(UC[VID]==1)
{
   DestroyObject(Siren[UC]);
   UC[VID]=0;
}
If it doesn't work tell me what UC and VID stand for,plus what the siren is,is an object attached by you to a vehicle?


Re: Object refuses to remove itself. - Marricio - 03.04.2012

Do you use an object streamer?


Re: Object refuses to remove itself. - iLcke - 03.04.2012

DestroyObject(Siren[UC]); will not work. VID is the vehicle ID.

I use Fallouts streamer-..Yeah.. Damnit.


Re: Object refuses to remove itself. - Cjgogo - 03.04.2012

Why won't you try this?(You did NOT tell me what UC stands for):
pawn Код:
if(UC[VID]==1)
{
  DestroyObject(Siren[VID]);
  UC[VID]=0;
}



Re: Object refuses to remove itself. - Marricio - 03.04.2012

Show the whole code, including the part where you created the object.


Re: Object refuses to remove itself. - MP2 - 03.04.2012



I'm guessing VID is the vehicle ID, so you should use that as the index for the array. What is UC?


Re: Object refuses to remove itself. - iLcke - 03.04.2012

UC is for the vehicles to see if they have a siren.
Thats why I have UC[VID] = 0; afterwards, cause when the siren gets put onto the vehicle the value would change to one.

VID is VehicleID.

pawn Код:
new CU[MAX_VEHICLES];
new Siren[MAX_VEHICLES];
new VID = GetPlayerVehicleID(playerid);

if(UC[VID] == 1)
{
DestroyObject(siren[UC]);
UC[VID] = 0;
return 1;
}