Advertisement
Guest User

Untitled

a guest
Jun 13th, 2015
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.12 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. #include <YSI\y_iterate>
  8. #include <YSI\y_inline>
  9. #include <YSI\y_dialog>
  10. #include <YSI\y_commands>
  11. #include <YSI\y_timers>
  12.  
  13. #define FILTERSCRIPT
  14.  
  15. #define MAX_VEH_SPOTS   (5)
  16.  
  17.    
  18.  
  19. enum vehSpots {
  20.  
  21.     vsID,           vsPrice,
  22.     Float:vsMinX,   Float:vsMinY,
  23.     Float:vsMaxX,   Float:vsMaxY
  24. }
  25. static
  26.     getRektM8[MAX_VEH_SPOTS][vehSpots] = {
  27.    
  28.     {1, 500, -200.0, 50.0, 50.1, 50.0},
  29.     {2, 200, -200.0, 50.0, 50.1, 50.0},
  30.     {3, 300, -200.0, 50.0, 50.1, 50.0},
  31.     {4, 400, -200.0, 50.0, 50.1, 50.0},
  32.     {5, 700, -200.0, 50.0, 50.1, 50.0}
  33. };
  34.  
  35. enum cw {
  36.  
  37.     cParkID,        Float:cParkedX,
  38.     Float:cParkedY, Float:cParkedZ,
  39.             Float:cAngle
  40. }
  41.  
  42. static
  43.     cGetRektM8[MAX_VEHICLES][cw],
  44.     Iterator:StreamedVehicles<MAX_VEHICLES>
  45. ;
  46.  
  47. public OnFilterScriptInit()
  48. {
  49.     print("Pati geriausia sistema paleista");
  50.     for (new idx = 0; idx != MAX_VEH_SPOTS; idx++) {
  51.    
  52.         printf(" DEBUG with idx: %i for vsID: %i", idx, getRektM8[idx][vsID]);
  53.     }
  54.     Timer_StreamedVehicles();
  55.     return 1;
  56. }
  57.  
  58.  
  59. YCMD:parkuot(playerid, params[], help) {
  60.  
  61.     #pragma unused params, help
  62.    
  63.     new
  64.         vehicleID = GetPlayerVehicleID(playerid)
  65.     ;
  66.    
  67.     if (vehicleID == INVALID_VEHICLE_ID)
  68.         return SendClientMessage(playerid, -1, "Savo siknutes parkuot negali, nusipirk tacka");
  69.        
  70.     return (true);
  71. }
  72.  
  73. task Timer_StreamedVehicles[2000]()
  74. {
  75.     foreach(new veh : StreamedVehicles) {
  76.    
  77.         if (GetVehicleModel(veh) != 0) {
  78.        
  79.             if (cGetRektM8[veh][cParkID] != 0) {
  80.            
  81.                 new
  82.                     Float:vehX,
  83.                     Float:vehY,
  84.                     Float:vehZ
  85.                 ;
  86.                 GetVehiclePos(veh, vehX, vehY, vehZ);
  87.                
  88.                 if (cGetRektM8[veh][cParkedX] != vehX && cGetRektM8[veh][cParkedY] != vehY && cGetRektM8[veh][cParkedZ] != vehZ) {
  89.                
  90.                     SendClientMessageToAll(-1, "OMG KAZKAS PAJUDINO TACKA SUPISKIT GALVA");
  91.                     SetVehiclePos(veh, cGetRektM8[veh][cParkedX], cGetRektM8[veh][cParkedY], cGetRektM8[veh][cParkedZ]);
  92.                     SetVehicleZAngle(veh, cGetRektM8[veh][cAngle]);
  93.  
  94.                     continue;
  95.                 }
  96.             }
  97.         }
  98.     }
  99.     return (true);
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement