15.01.2018, 12:43
It's because you are always making a new car under the same id as the last one...
Try adding [100] to the scar variable.
new sCar[MAX_PLAYERS][100];
And then when making a new car make a loop to check for an available vehicleid
Like this:
for(new v=0;v<100;v++)
{
if (!IsValidVehicle(sCar[playerid][v]))
{
sCar[playerid][v] = CreateVehicle(...);
return 1;
}
}
This is only if you want to be able to make 100 cars...
You could set the variable to 3 and then when spawning a 4th one check if the first is a valid vehicle and destroy it and then use it's id for the new car for example...
Try adding [100] to the scar variable.
new sCar[MAX_PLAYERS][100];
And then when making a new car make a loop to check for an available vehicleid
Like this:
for(new v=0;v<100;v++)
{
if (!IsValidVehicle(sCar[playerid][v]))
{
sCar[playerid][v] = CreateVehicle(...);
return 1;
}
}
This is only if you want to be able to make 100 cars...
You could set the variable to 3 and then when spawning a 4th one check if the first is a valid vehicle and destroy it and then use it's id for the new car for example...