Advertisement
Guest User

W_points test.

a guest
May 15th, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.28 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MAX_POINTS (40001)
  4. #define MAX_POINTS_TO_STREAM (200)
  5. //#define PointWorld (10)
  6. //#define PointInterior (10)
  7. #define DeBug
  8.  
  9. #include "D:\SA-MP_0.3X\include\Core\W_PS"
  10. #include "D:\CR-MP_Server\include\Core\streamer"
  11.  
  12. public OnFilterScriptInit()
  13. {
  14. //==Test 1
  15.     new tick=GetTickCount();
  16.     for(new x=-1000; x < 1000;x+=10)for(new y=-1000; y < 1000;y+=10)CreatePoint(x, y, 10.0, 20.0);
  17.     printf("Create W_Point %d",GetTickCount()-tick);
  18.  
  19.     tick=GetTickCount();
  20.     for(new i; i < 1000;i++)GetPlayerPoint(0, 2);
  21.     printf("GetW_Point %d",GetTickCount()-tick);
  22. //==Test 2
  23.     tick=GetTickCount();
  24.     for(new x=-1000; x < 1000;x+=10)for(new y=-1000; y < 1000;y+=10)CreateDynamicSphere(x, y, 10.0, 20.0);
  25.     printf("Create Streamer %d",GetTickCount()-tick);
  26.  
  27.     tick=GetTickCount();
  28.     for(new i; i < 1000;i++)IsPointInAnyDynamicArea(0.0, 0.0, 0.0);
  29.     printf("GetStreamerPoint %d",GetTickCount()-tick);
  30. //==Test 3
  31.     tick=GetTickCount();
  32.     new Float:x=1000.0,Float:y,Point;
  33.     for(new i; i < 1000;i++)
  34.     for(new P=MAX_POINTS-Point_Points; P<MAX_POINTS;P++)
  35.     {
  36.         y=GetPlayerDistanceFromPoint(0, PointX[P], PointY[P], PointZ[P]);
  37.         if(y < x)
  38.         {
  39.             x=y;
  40.             Point=P;
  41.         }
  42.     }
  43.     printf("GetClassicPoint %d",GetTickCount()-tick);
  44. //==
  45.     DestroyAllPoint();
  46.     return 1;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement