Help Car spawning
#1

Hello, I need some help. How can I make cars that i spawn disapear whe a player spawns anothere one?
Reply
#2

You can use OnVehicleSpawn.
Reply
#3

cough... this advice kinda fails...
you can use a variable..
"new spawned[MAX_VEHICLES]";
at the command:
pawn Код:
new v = CreateVehicle(............); //if you have another variable defined for the vehicleid you can use this ofc.
spawned[v] = 1;
for(new vid=0; vid<MAX_VEHICLES; vid++)
{
    if(spawned[vid] == 1 && vid != v)
    {
        spawned[vid] = 0;
        DestroyVehicle(vid);
    }
}
Reply
#4

Thanks
Reply
#5

Were does this go?
pawn Код:
new v = CreateVehicle(............); //if you have another variable defined for the vehicleid you can use this ofc.
spawned[v] = 1;
for(new vid=0; vid<MAX_VEHICLES; vid++)
{
    if(spawned[vid] == 1 && vid != v)
    {
        spawned[vid] = 0;
        DestroyVehicle(vid);
    }
}
Reply
#6

It goes under the command.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)