here is what i do in drugwars when i want to spawn peds, it didnt get rid of my problem completely but made ped spawning much more stable:
| CODE |
void CleanUpBeforeSpawn() { foreach (Ped ped in World.GetAllPeds()) { if (ped == Game.LocalPlayer.Character) continue; if (ped.isOnScreen) continue;
if (ped.isInVehicle()) { ped.CurrentVehicle.Delete(); } else{ ped.Delete(); } } } |
Because this skips on screen peds, u will never notice and just add extra checks for whatever peds are mission critical and u dont want to delete, This helps cleanup the world and make room for your peds before the game spawns the ped limit. This is all in theory by the way, I could be wrong ;D
This post has been edited by ch3y3zze on Wednesday, Sep 5 2012, 01:42