Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CriarMapa() {
- new const MAX_OBJECTS_TRASH = 30000;
- new arrayObject[] = {
- 2675,2675,3057,13591,12954,853,854,12957,3171,
- 2907,2907,1358,1450,3057,1442,928,853,3092,14404,
- 1327,2672,3005,3594,12954,3057,2907,874,848,843,826,747,
- 1450,1333,2670,1442,3057,2906,2906,854,874,888,761,826,12957,12954,
- 1119,1442,3119,849,2905,3005,1442,3302,874,1370,1338,774,888,826,3594,12957,
- 3594,2905,849,1327,2672,1349,849,3119,1333,761,803,16304,826,826,
- 2670,3073,2905,2906,2670,2906,2908,3594,2907,2971,3119,2672,826,14404
- };
- for(new a; a < MAX_OBJECTS_TRASH; a++)
- {
- new r = random(sizeof(CityArea));
- new Float: x, Float: y, Float: z ;
- x = float( floatround((random(floatround(CityArea[r][3] - CityArea[r][0])) + CityArea[r][0])));
- y = float( floatround((random(floatround(CityArea[r][4] - CityArea[r][1])) + CityArea[r][1])));
- z = MapAndreasFindZCoord(x, y);
- new c = NearestNodeFromPoint(x, y, z);
- if(~c) {
- new Float: tx, Float:ty, Float:tz;
- GetNodePos(c,tx,ty,tz);
- new j;
- for( ; a < MAX_OBJECTS_TRASH; a++) {
- new Float: rr1 = float(random(200)) * (random(10) %2 == 0 ? 1 : -1);
- new Float: rr2 = float(random(200)) * (random(10) %2 == 0 ? 1 : -1);
- new Float: xxx = tx + rr1;
- new Float: yyy = ty + rr2;
- j ++;
- if(j > 120) break;
- if(floatabs(MapAndreasFindZCoord(xxx,yyy)-tz) > 1) {
- a--; continue;
- }
- CreateDynamicObject(arrayObject[random(sizeof arrayObject)], xxx,yyy,MapAndreasFindZCoord(xxx, yyy)+0.01, 0.00000, 0.00000, 0.05999,.streamdistance = 450.0);
- }
- }
- else a--;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement