Object refuses to remove itself.
#1

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.
Reply
#2

Show us where you defined the object Siren
Reply
#3

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

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?
Reply
#5

Do you use an object streamer?
Reply
#6

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

I use Fallouts streamer-..Yeah.. Damnit.
Reply
#7

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;
}
Reply
#8

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



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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)