Quote:
Originally Posted by jlalt
how player will have vehicle on his connect D: ?
after creating your vehicles add this code
PHP код:
native IsValidVehicle(vehicleid); // <- add this after a_samp include
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(!IsValidVehicle(i)) continue;
new rand = random(3000) + 1500;
new string[24];
format(string, sizeof(string), "{D20000}BG-{FFFFFF}%d", rand);
SetVehicleNumberPlate(i, string);
}
|
MAX_VEHICLES is 2000 by default. If he only has like 200 cars, it will continue looping for 1800 times for no reason.
You should use GetVehiclePoolSize instead, especially since it's under OnGameModeInit, so there will be no empty loops.
Код:
for (new i, j = GetVehiclePoolSize(); i <= j; i++)