Advertisement
McFree

SAMP UDF_037 GetZoneByName func

Feb 13th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; CurZone[1] - Zone Name
  2. ; CurZone[2] - Zone ID
  3. ; CurZone[3] - Array of arrays points positions
  4. ; CurZone[3,1] - Array of thirst point position
  5. ; CurZone[3,1,1] - Zone X1
  6. ; CurZone[3,1,2] - Zone Y1
  7. ; CurZone[3,1,3] - Zone Z1
  8. ; CurZone[3,2] - Array of second point position
  9. ; CurZone[3,2,1] - Zone X2
  10. ; CurZone[3,2,2] - Zone Y2
  11. ; CurZone[3,2,3] - Zone Z2
  12.  
  13. getZoneByName(zName, ByRef CurZone ) {
  14.      if ( bInitZaC == 0 )
  15.     {
  16.         initZonesAndCities()
  17.         bInitZaC := 1
  18.     }
  19.        
  20.     Loop % nZone-1
  21.     {
  22.         if (zone%A_Index%_name == zName)
  23.         {
  24.             ErrorLevel := ERROR_OK
  25.             CurZone[1] :=  zone%A_Index%_name
  26.             CurZone[2] := %A_Index%
  27.             CurZone[3,1,1] := zone%A_Index%_x1
  28.             CurZone[3,1,2] := zone%A_Index%_y1
  29.             CurZone[3,1,3] := zone%A_Index%_z1
  30.             CurZone[3,2,1] := zone%A_Index%_x2
  31.             CurZone[3,2,2] := zone%A_Index%_y2
  32.             CurZone[3,2,3] := zone%A_Index%_z2
  33.             return true
  34.         }
  35.     }
  36.     ErrorLevel := ERROR_ZONE_NOT_FOUND
  37.     return "Unbekannt"
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement