Car spawn help
#4

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...
Reply


Messages In This Thread
Car spawn help - by ,TomY' - 14.01.2018, 15:31
Re: Car spawn help - by ,TomY' - 14.01.2018, 17:09
Re: Car spawn help - by KayJ - 15.01.2018, 12:33
Re: Car spawn help - by andrejc999 - 15.01.2018, 12:43

Forum Jump:


Users browsing this thread: 1 Guest(s)