Advertisement
ipsBruno

(Pawn) CriarMapa ZUMBI

Jul 29th, 2014
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.59 KB | None | 0 0
  1. CriarMapa() {
  2.  
  3.     new const MAX_OBJECTS_TRASH = 30000;
  4.  
  5.     new arrayObject[] = {
  6.         2675,2675,3057,13591,12954,853,854,12957,3171,
  7.         2907,2907,1358,1450,3057,1442,928,853,3092,14404,
  8.         1327,2672,3005,3594,12954,3057,2907,874,848,843,826,747,
  9.         1450,1333,2670,1442,3057,2906,2906,854,874,888,761,826,12957,12954,
  10.         1119,1442,3119,849,2905,3005,1442,3302,874,1370,1338,774,888,826,3594,12957,
  11.         3594,2905,849,1327,2672,1349,849,3119,1333,761,803,16304,826,826,
  12.         2670,3073,2905,2906,2670,2906,2908,3594,2907,2971,3119,2672,826,14404
  13.     };
  14.  
  15.     for(new a; a < MAX_OBJECTS_TRASH; a++)
  16.     {
  17.  
  18.         new r = random(sizeof(CityArea));
  19.  
  20.  
  21.         new Float: x, Float: y, Float: z ;
  22.  
  23.         x = float( floatround((random(floatround(CityArea[r][3] - CityArea[r][0])) + CityArea[r][0])));
  24.         y = float( floatround((random(floatround(CityArea[r][4] - CityArea[r][1])) + CityArea[r][1])));
  25.  
  26.         z = MapAndreasFindZCoord(x, y);
  27.  
  28.         new c =  NearestNodeFromPoint(x, y, z);
  29.  
  30.  
  31.         if(~c) {
  32.             new Float: tx, Float:ty, Float:tz;
  33.             GetNodePos(c,tx,ty,tz);
  34.             new j;
  35.             for( ; a < MAX_OBJECTS_TRASH; a++) {
  36.  
  37.                 new Float: rr1 = float(random(200)) * (random(10) %2 == 0 ? 1 : -1);
  38.                 new Float: rr2 = float(random(200)) * (random(10) %2 == 0 ? 1 : -1);
  39.                 new Float: xxx = tx + rr1;
  40.                 new Float: yyy = ty + rr2;
  41.  
  42.                 j ++;
  43.                 if(j > 120) break;
  44.  
  45.                 if(floatabs(MapAndreasFindZCoord(xxx,yyy)-tz) > 1) {
  46.                     a--; continue;
  47.                 }
  48.  
  49.                 CreateDynamicObject(arrayObject[random(sizeof arrayObject)], xxx,yyy,MapAndreasFindZCoord(xxx, yyy)+0.01,   0.00000, 0.00000, 0.05999,.streamdistance = 450.0);
  50.  
  51.             }
  52.         }
  53.         else a--;
  54.     }
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement