AddStaticVehicleEx
#1

Does the vehicle keeps the same ID when it's respawned/destroyed or it changes?
Reply
#2

Test it with print()?

When vehicles are created, they take the lowest available ID.
Reply
#3

It's hard to test it on a test server all by myself, because on a real server there is so many unknown variables and combinations that can take place. If they don't keep the same id, how can I set a new id of the car?
Reply
#4

pawn Код:
new myCar1;

public OnGameModeInit()
{
   myCar1 = AddStaticVehicle(therestofthestuff)  //or with Ex
}
Reply
#5

I've done that, just wondering if the ID changes on respawn or not. I know that with CreateVehicle, on respawn it conflicted with some ID's
Reply
#6

Try this:

pawn Код:
new vehicle[3];

public OnGameModeInit()
{
    vehicle[0] = CreateVehicle(...);
    vehicle[1] = CreateVehicle(...);
    vehicle[2] = CreateVehicle(...);
    return 1;
}

// In a command:
DestroyVehicle(vehicle[1]);

public OnVehicleRespawn(vehicleid)
{
    new string[32];
    format(string, sizeof(string), "Vehicle %i respawned.", vehicleid);
    SendClientMessageToAll(-1, string);
}
Get in to vehicle[2] and destroy it, making it respawn. It should say 'vehicle 3 respawned' if the ID stayed the same. If it takes the place of vehicle[1], it will say 'vehicle 2 respawned'. Then see the client message.

NOTE: This needs to be a BLANK gamemode, with no other vehicles.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)