DECLARE iSpawnNumVeh SMALLINT(3) DEFAULT 11;
CALL pCleanup();
CALL pFixMaxNum;
SELECT SUM(MaxNum) FROM object_classes INTO @iMaxNumTotal;
IF (iSpawnNumVeh > @iMaxNumTotal) THEN
SET iSpawnNumVeh = @iMaxNumTotal;
END IF;
WHILE (fGetVehCount() < iSpawnNumVeh) DO
CALL pSpawn();
END WHILE;
That's some pretty funky code man. Essentially, the code will never allow for users to have MORE then 11 vehicles, and only have less then that. Should instead be:
DECLARE iSpawnNumVeh SMALLINT(3) DEFAULT 0;
CALL pCleanup();
CALL pFixMaxNum;
SELECT SUM(MaxNum) FROM object_classes INTO @iMaxNumTotal;
IF (iSpawnNumVeh < @iMaxNumTotal) THEN
SET iSpawnNumVeh = @iMaxNumTotal;
END IF;
WHILE (fGetVehCount() < iSpawnNumVeh) DO
CALL pSpawn();
END WHILE;
This way, user's have the ability to set NO vehicles on the map if they want, but otherwise the code will pick up the amount of vehicles correctly.
If you haven't already I will be doing some testing on this in the future. ATM I am getting BSOD's. I will investigate when my new rig comes in. Thanks for the contribution.
Current code:
That's some pretty funky code man. Essentially, the code will never allow for users to have MORE then 11 vehicles, and only have less then that. Should instead be:
This way, user's have the ability to set NO vehicles on the map if they want, but otherwise the code will pick up the amount of vehicles correctly.