[HELP] respawn
#1

Hello. How can I make in this code that when I respawn all vehicles I want not to respawn trailers if you know what I mean?


pawn Код:
new bool:unwanted[CAR_AMOUNT];
    for(new player=0; player<MAX_PLAYERS; player++)
    {
        if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
    }
    for(new car = 1; car < CAR_AMOUNT; car++)
    {
        if(!unwanted[car] && GetVehicleModel(car) != 584) SetVehicleToRespawn(car);
    }
Reply
#2

pawn Код:
for(new car = 1; car < CAR_AMOUNT; car++)
    {
        if(!unwanted[car] && GetVehicleModel(car) != 584 && GetVehicleModel(car) != 435 && GetVehicleModel(car) != 591) SetVehicleToRespawn(car);
    }
This should work.. Though didn't test it.
Reply
#3

It's set this in the first place in my code and I was make resspawn and with vehicles trailers also respawned. That code won't work. Thanks for replying
Reply
#4

Try this

define RespawnTime "2000" //You can change time to respawn vehicles here!

Quote:

public RespawnVehicles()
{
for(new c = 0; c < MAX_VEHICLES; c++)
{
if(c != INVALID_VEHICLE_ID)
{
if(IsVehicleEmpty©) SetVehicleToRespawn©;
}
}
return 1;
}

Quote:
public OnGameModeInit()
{
SetTimer("RespawnVehicles", RespawnTime, 1);
return 1;
}

Reply
#5

Quote:
Originally Posted by MattTucker
Посмотреть сообщение
pawn Код:
for(new car = 1; car < CAR_AMOUNT; car++)
    {
        if(!unwanted[car] && GetVehicleModel(car) != 584 && GetVehicleModel(car) != 435 && GetVehicleModel(car) != 591) SetVehicleToRespawn(car);
    }
This should work.. Though didn't test it.
Thanks mate I was trying something like tht and for me it wasn't working, and I was put your code and it workin I make respawn all vehicles and the trailers didn't respawn. Thanks again.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)