Vehicle Object problem
#1

~~~~~~
Reply
#2

You're not checking if i is connected. You're deleting 400 (assuming you've got 100 players on attaching an object) objects that don't exist.


Also, you're never deleting the objects theyselves under OnVehicleDeath, you need to loop thru AttachedObjects to delete them all:

pawn Код:
for(new a = 0; a < sizeof(AttachedObjects[]); a ++)
    if(AttachedObject[vehicleid][a] != 0)
       DestroyObject(AttachedObject[vehicleid][a]),
       AttachedObject[vehicleid][a] = 0;
Reply
#3

~~~~~~
Reply
#4

You have several possible solutions:

A) Create a new function and call it after you destroy the vehicle, delete the objects there;
B) Clear the objects in the function you're using DestroyVehicle
C) Call OnVehicleDead before using DestroyVehicle
Reply
#5

~~~~~~
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)