Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pickLocation(%db, %tryGroup)
- {...
- //check for open areas to spawn in around the spawnpoint
- %offset = getRandom(0, 10)-5 SPC getRandom(0, 10)-5 SPC "0";
- %pos = vectorAdd(%spawn.getPosition(), %offset);
- %mask = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::StaticObjectType | $TypeMasks::StaticShapeObjectType;
- %okay = containerBoxEmpty(%mask,%pos,2);
- //no space? bail
- if(!%okay)
- {
- return false;
- }
- //spawn
- %player = AIPlayer::CustomAiSpawn(%spawn, %db);
- ...}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement