Advertisement
Guest User

Untitled

a guest
Apr 9th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.62 KB | None | 0 0
  1. public Detector_Load()
  2. {
  3.     static
  4.         rows,
  5.         fields;
  6.  
  7.     cache_get_data(rows, fields, g_iHandle);
  8.  
  9.     for (new i = 0; i < rows; i ++) if (i < MAX_METAL_DETECTORS)
  10.     {
  11.         MetalDetectors[i][detectorExists] = 1;
  12.         MetalDetectors[i][detectorID] = cache_get_field_int(i, "detectorID");
  13.         MetalDetectors[i][detectorPos][0] = cache_get_field_float(i, "detectorX");
  14.         MetalDetectors[i][detectorPos][1] = cache_get_field_float(i, "detectorY");
  15.         MetalDetectors[i][detectorPos][2] = cache_get_field_float(i, "detectorZ");
  16.         MetalDetectors[i][detectorPos][3] = cache_get_field_float(i, "detectorAngle");
  17.         MetalDetectors[i][detectorInterior] = cache_get_field_int(i, "detectorInterior");
  18.         MetalDetectors[i][detectorWorld] = cache_get_field_int(i, "detectorWorld");
  19.  
  20.         Detector_Refresh(i);
  21.     }
  22.     return 1;
  23. }
  24.  
  25. public LoadTurfs()
  26. {
  27.     static
  28.         rows,
  29.         fields,
  30.         result[100],
  31.         index;
  32.  
  33.     cache_get_data(rows, fields, g_iHandle);
  34.  
  35.     for (new i = 0; i < rows; i ++) {
  36.         cache_get_field_int(i, "ID", index);
  37.         TurfInfo[index][zID] = index;
  38.         cache_get_field(i, "Owned", result);        TurfInfo[index][zOwned] = strval(result);
  39.         cache_get_field(i, "Time", result);         TurfInfo[index][zTime] = strval(result);
  40.         cache_get_field(i, "MinX", result);         TurfInfo[index][zMinX] = floatstr(result);
  41.         cache_get_field(i, "MinY", result);         TurfInfo[index][zMinY] = floatstr(result);
  42.         cache_get_field(i, "MaxX", result);         TurfInfo[index][zMaxX] = floatstr(result);
  43.         cache_get_field(i, "MaxY", result);         TurfInfo[index][zMaxY] = floatstr(result);
  44.     }
  45.  
  46.     printf("[MySQL Turfs]: %d", index);
  47.     return 1;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement