AwDod

policeinfernus.inc

Oct 24th, 2023
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.56 KB | None | 0 0
  1. #if defined POLICEINFERNUS
  2.     #endinput
  3. #endif
  4. #define POLICEINFERNUS
  5.  
  6. #if !defined INFERNUS
  7.     #define INFERNUS        411
  8. #endif
  9.  
  10. #if !defined MAX_INFERNUS_OBJECTS
  11.     #define MAX_INFERNUS_OBJECTS    12
  12. #endif
  13.  
  14. static
  15.     police_infernus[MAX_VEHICLES][MAX_INFERNUS_OBJECTS] = {INVALID_OBJECT_ID, ...};
  16.  
  17. stock CreatePoliceInfernus(Float:x, Float:y, Float:z, Float:a, respawn = 0)
  18. {
  19.     static
  20.         vehicleid,
  21.         objectid;
  22.  
  23.     vehicleid = CreateVehicle(INFERNUS, x, y, z, a, 0, 0, respawn, 1);
  24.  
  25.     objectid = CreateDynamicObject(19476, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  26.     SetDynamicObjectMaterialText(objectid, 0, !"POLICE", 120, !"Arial", 100, 1, -1, 0, 1);
  27.     AttachDynamicObjectToVehicle(objectid, vehicleid, -0.001276, 2.790166, -0.456286, 0.000000, 21.799999, 90.000000);
  28.     police_infernus[vehicleid][0] = objectid;
  29.  
  30.     objectid = CreateDynamicObject(19477, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  31.     SetDynamicObjectMaterialText(objectid, 0, !"POLICE", 130, !"Arial", 60, 1, -1, 0, 1);
  32.     AttachDynamicObjectToVehicle(objectid, vehicleid, 0.001995, -1.970654, 0.239949, 0.000000, -85.200073, -90.000000);
  33.     police_infernus[vehicleid][1] = objectid;
  34.  
  35.     objectid = CreateDynamicObject(19797, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  36.     AttachDynamicObjectToVehicle(objectid, vehicleid, -0.623635, 2.719873, -0.489997, 197.100002, 0.000000, -168.299880);
  37.     police_infernus[vehicleid][2] = objectid;
  38.     objectid = CreateDynamicObject( 19797, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  39.     AttachDynamicObjectToVehicle(objectid, vehicleid, 0.623635, 2.719873, -0.489997, 197.100002, 0.000000, 168.299880);
  40.     police_infernus[vehicleid][3] = objectid;
  41.  
  42.     objectid = CreateDynamicObject(19797, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  43.     AttachDynamicObjectToVehicle(objectid, vehicleid, -0.778895, -2.520503, -0.455543, 202.600015, 0.000000, -4.399932);
  44.     police_infernus[vehicleid][4] = objectid;
  45.     objectid = CreateDynamicObject(19797, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  46.     AttachDynamicObjectToVehicle(objectid, vehicleid, 0.778895, -2.520503, -0.455543, 202.600015, 0.000000, 4.399932);
  47.     police_infernus[vehicleid][5] = objectid;
  48.  
  49.     objectid = CreateDynamicObject(19620, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  50.     SetDynamicObjectMaterial(objectid, 0, 19620, !"LightBar1", !"lightbar1", 0xFFFFFFFF);
  51.     AttachDynamicObjectToVehicle(objectid, vehicleid, 0.000000, 0.159840, 0.709995, 0.000000, 0.000000, 0.000000);
  52.     police_infernus[vehicleid][6] = objectid;
  53.  
  54.     return vehicleid;
  55.  
  56. }
  57.  
  58. public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
  59. {
  60.     if (police_infernus[vehicleid][0] != INVALID_OBJECT_ID)
  61.     {
  62.         if (newstate)
  63.         {
  64.             static
  65.                 objectid;
  66.  
  67.             AttachDynamicObjectToVehicle(police_infernus[vehicleid][2], vehicleid, -0.623635, 2.719873, -0.489997, 17.100002, 0.000000, -168.299880);
  68.             AttachDynamicObjectToVehicle(police_infernus[vehicleid][3], vehicleid, 0.623635, 2.719873, -0.489997, 17.100002, 180.000000, 168.299880);
  69.             AttachDynamicObjectToVehicle(police_infernus[vehicleid][4], vehicleid, -0.778895, -2.520503, -0.455543, 22.600015, 180.000000, -4.399932);
  70.             AttachDynamicObjectToVehicle(police_infernus[vehicleid][5], vehicleid, 0.778895, -2.520503, -0.455543, 22.600015, 0.000000, 4.399932);
  71.  
  72.             DestroyDynamicObject(police_infernus[vehicleid][6]);
  73.             police_infernus[vehicleid][6] = CreateDynamicObject(19620, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  74.             AttachDynamicObjectToVehicle(police_infernus[vehicleid][6], vehicleid, -0.000567, 0.159840, 0.709995, 0.000000, 0.000000, 0.000000);
  75.  
  76.             objectid = CreateDynamicObject(19419, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  77.             SetDynamicObjectMaterialText(objectid, 0, !"_", 130, !"Arial", 60, 0, 0, 0, 1);
  78.             AttachDynamicObjectToVehicle(objectid, vehicleid, 0.000000, 0.159840, 0.709995, 0.000000, 0.000000, 180.000000);
  79.             police_infernus[vehicleid][7] = objectid;
  80.  
  81.             objectid = CreateDynamicObject(19419, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  82.             SetDynamicObjectMaterialText(objectid, 0, !"_", 130, !"Arial", 60, 0, 0, 0, 1);
  83.             AttachDynamicObjectToVehicle(objectid, vehicleid, -0.100000, 2.820966, -0.900011, 0.000000, 0.000000, 10.0000);
  84.             police_infernus[vehicleid][8] = objectid;
  85.             objectid = CreateDynamicObject(19419, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  86.             SetDynamicObjectMaterialText(objectid, 0, !"_", 130, !"Arial", 60, 0, 0, 0, 1);
  87.             AttachDynamicObjectToVehicle(objectid, vehicleid, 0.10000, 2.820966, -0.900011, 0.000000, 0.000000, -190.0000);
  88.             police_infernus[vehicleid][9] = objectid;
  89.  
  90.             objectid = CreateDynamicObject(19419, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  91.             SetDynamicObjectMaterialText(objectid, 0, !"_", 130, !"Arial", 60, 0, 0, 0, 1);
  92.             AttachDynamicObjectToVehicle(objectid, vehicleid, 0.10000, -2.637919, -0.900011, 0.000000, 0.000000, 190.0000);
  93.             police_infernus[vehicleid][10] = objectid;
  94.             objectid = CreateDynamicObject(19419, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
  95.             SetDynamicObjectMaterialText(objectid, 0, !"_", 130, !"Arial", 60, 0, 0, 0, 1);
  96.             AttachDynamicObjectToVehicle(objectid, vehicleid, -0.10000, -2.637919, -0.900011, 0.000000, 0.000000, -10.0000);
  97.             police_infernus[vehicleid][11] = objectid;
  98.  
  99.             Streamer_Update(playerid, STREAMER_TYPE_OBJECT);
  100.         }
  101.         else
  102.         {
  103.             PoliceInfernusToOff(vehicleid);
  104.         }
  105.     }
  106.  
  107.     #if  defined pi_OnVehicleSirenStateChange
  108.         pi_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  109.     #endif
  110.  
  111.     return 1;
  112. }
  113.  
  114. #if defined _ALS_OnVehicleSirenStateChange
  115.     #undef  OnVehicleSirenStateChange
  116. #else
  117.     #define _ALS_OnVehicleSirenStateChange
  118. #endif
  119. #define OnVehicleSirenStateChange   pi_OnVehicleSirenStateChange
  120. #if defined pi_OnVehicleSirenStateChange
  121.     forward pi_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  122. #endif
  123.  
  124. public OnVehicleDeath(vehicleid, killerid)
  125. {
  126.     PoliceInfernusToOff(vehicleid);
  127.    
  128.     #if  defined pi_OnVehicleDeath
  129.         pi_OnVehicleDeath(vehicleid, killerid);
  130.     #endif
  131.  
  132.     return 1;
  133. }
  134.  
  135. #if defined _ALS_OnVehicleDeath
  136.     #undef  OnVehicleDeath
  137. #else
  138.     #define _ALS_OnVehicleDeath
  139. #endif
  140. #define OnVehicleDeath  pi_OnVehicleDeath
  141. #if defined pi_OnVehicleDeath
  142.     forward pi_OnVehicleDeath(vehicleid, killerid);
  143. #endif
  144.  
  145. static stock PoliceInfernusToOff(vehicleid)
  146. {
  147.     AttachDynamicObjectToVehicle(police_infernus[vehicleid][2], vehicleid, -0.623635, 2.719873, -0.489997, 197.100002, 0.000000, -168.299880);
  148.     AttachDynamicObjectToVehicle(police_infernus[vehicleid][3], vehicleid, 0.623635, 2.719873, -0.489997, 197.100002, 0.000000, 168.299880);
  149.     AttachDynamicObjectToVehicle(police_infernus[vehicleid][4], vehicleid, -0.778895, -2.520503, -0.455543, 202.600015, 0.000000, -4.399932);
  150.     AttachDynamicObjectToVehicle(police_infernus[vehicleid][5], vehicleid, 0.778895, -2.520503, -0.455543, 202.600015, 0.000000, 4.399932);
  151.  
  152.     SetDynamicObjectMaterial(police_infernus[vehicleid][6], 0, 19620, !"LightBar1", !"lightbar1", 0xFFFFFFFF);
  153.  
  154.     DestroyDynamicObject(police_infernus[vehicleid][7]);
  155.     DestroyDynamicObject(police_infernus[vehicleid][8]);
  156.     DestroyDynamicObject(police_infernus[vehicleid][9]);
  157.     DestroyDynamicObject(police_infernus[vehicleid][10]);
  158.     DestroyDynamicObject(police_infernus[vehicleid][11]);
  159.  
  160.     return 1;
  161. }
  162.  
  163. stock DestroyPoliceInfernus(vehicleid)
  164. {
  165.     DestroyVehicle(vehicleid);
  166.    
  167.     for (new i = 0; i < MAX_INFERNUS_OBJECTS; i++)
  168.     {
  169.         DestroyDynamicObject(police_infernus[vehicleid][i]);
  170.         police_infernus[vehicleid][i] = INVALID_OBJECT_ID;
  171.     }
  172.  
  173.     return 1;
  174. }
  175.  
  176. //by m1n1vv
Add Comment
Please, Sign In to add comment