Guest User

SPU [Special Police Units]

a guest
Dec 18th, 2010
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.03 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. /*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
  4. /*\\\\\\\\\\\Script made by Geso\\\\\\\\\\\*/
  5. /*http://forum.sa-mp.com/member.php?u=76396*/
  6. /*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
  7.  
  8. #define COLOR_GREEN 0x33AA33AA
  9. #define COLOR_RED 0xAA3333AA
  10.  
  11. new IsSpu[MAX_VEHICLES] = 0;
  12. new Lamp[MAX_VEHICLES] = 0;
  13. new light[MAX_VEHICLES];
  14.  
  15. public OnFilterScriptInit()
  16. {
  17.     print("\n--------------------------------------");
  18.     print(" SPU's  [Special Police Units]  by Geso ");
  19.     print("--------------------------------------\n");
  20.     return 1;
  21. }
  22.  
  23. public OnFilterScriptExit()
  24. {
  25.     return 1;
  26. }
  27.  
  28. public OnPlayerCommandText(playerid, cmdtext[])
  29. {
  30.     if (strcmp("/spu", cmdtext, true, 10) == 0)
  31.     {
  32.         ShowPlayerDialog(playerid, 112, DIALOG_STYLE_LIST, "So you want to have a SPU, what one do you want then?", "Sultan [dashboard]\nSultan [roof]\nCheetah [dashboard]\nCheetah [roof]\nWashington [dashboard]\nWashington [roof]\nPremier [dashboard]\nPremier [roof]", "Take it", "Leave it" );
  33.         return 1;
  34.     }
  35.     return 0;
  36. }
  37.  
  38. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  39. {
  40.     if(response == 1 && dialogid == 112)
  41.     {
  42.         switch(listitem)
  43.         {
  44.         // We'll use the switch/cases now because we're going to process a few results, not just one. Remember, the first item in the list has id 0.
  45.             case 0:
  46.             {//sultan lamp inside
  47.                 new Float:x, Float:y, Float:z, Float:angle;
  48.                 GetPlayerPos(playerid, x, y, z);
  49.                 GetPlayerFacingAngle(playerid, angle);
  50.                 new vehicleid=CreateVehicle(560, x, y, z, angle, 0, 0, -1);
  51.                 PutPlayerInVehicle(playerid, vehicleid, 0);
  52.                 SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  53.                 LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  54.                 IsSpu[vehicleid] = 1;
  55.                 Lamp[vehicleid] = 1;
  56.                 light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
  57.                 AttachObjectToVehicle(light[vehicleid], vehicleid, 0.398071289, 0.75390625, 0.43879509, 0.0, 0.0, 0.0);
  58.  
  59.             }
  60.             case 1:
  61.             {//sultan lamp outside
  62.                 new Float:x, Float:y, Float:z, Float:angle;
  63.                 GetPlayerPos(playerid, x, y, z);
  64.                 GetPlayerFacingAngle(playerid, angle);
  65.                 new vehicleid=CreateVehicle(560, x, y, z, angle, 0, 0, -1);
  66.                 PutPlayerInVehicle(playerid, vehicleid, 0);
  67.                 SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  68.                 LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  69.                 IsSpu[vehicleid] = 2;
  70.                 Lamp[vehicleid] = 1;
  71.                 light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
  72.                 AttachObjectToVehicle(light[vehicleid], vehicleid, -0.35644531250, 0.0388183593, 0.863788605, 0.0, 0.0, 0.0);
  73.             }
  74.             case 2:
  75.             {//cheetah lamp inside
  76.                 new Float:x, Float:y, Float:z, Float:angle;
  77.                 GetPlayerPos(playerid, x, y, z);
  78.                 GetPlayerFacingAngle(playerid, angle);
  79.                 new vehicleid=CreateVehicle(415, x, y, z, angle, 0, 0, -1);
  80.                 PutPlayerInVehicle(playerid, vehicleid, 0);
  81.                 SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  82.                 LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  83.                 IsSpu[vehicleid] = 3;
  84.                 Lamp[vehicleid] = 1;
  85.                 light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
  86.                 AttachObjectToVehicle(light[vehicleid], vehicleid, 0.409729004, 0.526367188, 0.206963539, 0.0, 0.0, 0.0);
  87.             }
  88.             case 3:
  89.             {//cheetah lamp outside
  90.                 new Float:x, Float:y, Float:z, Float:angle;
  91.                 GetPlayerPos(playerid, x, y, z);
  92.                 GetPlayerFacingAngle(playerid, angle);
  93.                 new vehicleid=CreateVehicle(415, x, y, z, angle, 0, 0, -1);
  94.                 PutPlayerInVehicle(playerid, vehicleid, 0);
  95.                 SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  96.                 LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  97.                 IsSpu[vehicleid] = 4;
  98.                 Lamp[vehicleid] = 1;
  99.                 light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
  100.                 AttachObjectToVehicle(light[vehicleid], vehicleid, -0.290039062, -0.284179688, 0.631957054, 0.0, 0.0, 0.0);
  101.             }
  102.             case 4:
  103.             {//wash lamp inside
  104.                 new Float:x, Float:y, Float:z, Float:angle;
  105.                 GetPlayerPos(playerid, x, y, z);
  106.                 GetPlayerFacingAngle(playerid, angle);
  107.                 new vehicleid=CreateVehicle(421, x, y, z, angle, 0, 0, -1);
  108.                 PutPlayerInVehicle(playerid, vehicleid, 0);
  109.                 SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  110.                 LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  111.                 IsSpu[vehicleid] = 5;
  112.                 Lamp[vehicleid] = 1;
  113.                 light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
  114.                 AttachObjectToVehicle(light[vehicleid], vehicleid, 0.421691895, 0.804931641, 0.256482124, 0.0, 0.0, 0.0);
  115.             }
  116.             case 5:
  117.             {//wash lamp outside
  118.                 new Float:x, Float:y, Float:z, Float:angle;
  119.                 GetPlayerPos(playerid, x, y, z);
  120.                 GetPlayerFacingAngle(playerid, angle);
  121.                 new vehicleid=CreateVehicle(421, x, y, z, angle, 0, 0, -1);
  122.                 PutPlayerInVehicle(playerid, vehicleid, 0);
  123.                 SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  124.                 LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  125.                 IsSpu[vehicleid] = 6;
  126.                 Lamp[vehicleid] = 1;
  127.                 light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
  128.                 AttachObjectToVehicle(light[vehicleid], vehicleid, -0.323303223, 0.0207519532, 0.731482506, 0.0, 0.0, 0.0);
  129.             }//done
  130.             case 6:
  131.             {//premier lamp inside
  132.                 new Float:x, Float:y, Float:z, Float:angle;
  133.                 GetPlayerPos(playerid, x, y, z);
  134.                 GetPlayerFacingAngle(playerid, angle);
  135.                 new vehicleid=CreateVehicle(426, x, y, z, angle, 0, 0, -1);
  136.                 PutPlayerInVehicle(playerid, vehicleid, 0);
  137.                 SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  138.                 LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  139.                 IsSpu[vehicleid] = 7;
  140.                 Lamp[vehicleid] = 1;
  141.                 light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
  142.                 AttachObjectToVehicle(light[vehicleid], vehicleid, 0.575378418, 0.786132812, 0.361483574, 0.0, 0.0, 0.0);
  143.             }
  144.             case 7:
  145.             {//premier lamp outside
  146.                 new Float:x, Float:y, Float:z, Float:angle;
  147.                 GetPlayerPos(playerid, x, y, z);
  148.                 GetPlayerFacingAngle(playerid, angle);
  149.                 new vehicleid=CreateVehicle(426, x, y, z, angle, 0, 0, -1);
  150.                 PutPlayerInVehicle(playerid, vehicleid, 0);
  151.                 SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  152.                 LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  153.                 IsSpu[vehicleid] = 8;
  154.                 Lamp[vehicleid] = 1;
  155.                 light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
  156.                 AttachObjectToVehicle(light[vehicleid], vehicleid, -0.455505371, -0.143066406, 0.861475945, 0.0, 0.0, 0.0);
  157.             }
  158.         }
  159.     }
  160.     return 1;
  161. }
  162.  
  163. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  164. {
  165.     if((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
  166.     {
  167.          VehicleLightSwitch(playerid);
  168.     }
  169.     return 1;
  170. }
  171.  
  172. VehicleLightSwitch(playerid)
  173. {
  174.         new vid = GetPlayerVehicleID(playerid);
  175.         if(vid == INVALID_VEHICLE_ID) return 1;
  176.         if(IsSpu[vid] == 1)
  177.         {
  178.             if(Lamp[vid] == 1)
  179.             {
  180.                  DestroyObject(light[vid]);
  181.                  Lamp[vid] = 0;
  182.                  return 1;
  183.             }
  184.             if(Lamp[vid] == 0)
  185.             {
  186.                  light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
  187.                  AttachObjectToVehicle(light[vid], vid, 0.398071289, 0.75390625, 0.43879509, 0.0, 0.0, 0.0);
  188.                  Lamp[vid] = 1;
  189.                  return 1;
  190.             }
  191.         }
  192.         if(IsSpu[vid] == 2)
  193.         {
  194.             if(Lamp[vid] == 1)
  195.             {
  196.                  DestroyObject(light[vid]);
  197.                  Lamp[vid] = 0;
  198.                  return 1;
  199.             }
  200.             if(Lamp[vid] == 0)
  201.             {
  202.                  light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
  203.                  AttachObjectToVehicle(light[vid], vid, -0.35644531250, 0.0388183593, 0.863788605, 0.0, 0.0, 0.0);
  204.                  Lamp[vid] = 1;
  205.                  return 1;
  206.             }
  207.         }
  208.         if(IsSpu[vid] == 3)
  209.         {
  210.             if(Lamp[vid] == 1)
  211.             {
  212.                  DestroyObject(light[vid]);
  213.                  Lamp[vid] = 0;
  214.                  return 1;
  215.             }
  216.             if(Lamp[vid] == 0)
  217.             {
  218.                  light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
  219.                  AttachObjectToVehicle(light[vid], vid, 0.409729004, 0.526367188, 0.206963539, 0.0, 0.0, 0.0);
  220.                  Lamp[vid] = 1;
  221.                  return 1;
  222.             }
  223.         }
  224.         if(IsSpu[vid] == 4)
  225.         {
  226.             if(Lamp[vid] == 1)
  227.             {
  228.                  DestroyObject(light[vid]);
  229.                  Lamp[vid] = 0;
  230.                  return 1;
  231.             }
  232.             if(Lamp[vid] == 0)
  233.             {
  234.                  light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
  235.                  AttachObjectToVehicle(light[vid], vid, -0.290039062, -0.284179688, 0.631957054, 0.0, 0.0, 0.0);
  236.                  Lamp[vid] = 1;
  237.                  return 1;
  238.             }
  239.         }
  240.         if(IsSpu[vid] == 5)
  241.         {
  242.             if(Lamp[vid] == 1)
  243.             {
  244.                  DestroyObject(light[vid]);
  245.                  Lamp[vid] = 0;
  246.                  return 1;
  247.             }
  248.             if(Lamp[vid] == 0)
  249.             {
  250.                  light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
  251.                  AttachObjectToVehicle(light[vid], vid, 0.421691895, 0.804931641, 0.256482124, 0.0, 0.0, 0.0);
  252.                  Lamp[vid] = 1;
  253.                  return 1;
  254.             }
  255.         }
  256.         if(IsSpu[vid] == 6)
  257.         {
  258.             if(Lamp[vid] == 1)
  259.             {
  260.                  DestroyObject(light[vid]);
  261.                  Lamp[vid] = 0;
  262.                  return 1;
  263.             }
  264.             if(Lamp[vid] == 0)
  265.             {
  266.                  light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
  267.                  AttachObjectToVehicle(light[vid], vid, -0.323303223, 0.0207519532, 0.731482506, 0.0, 0.0, 0.0);
  268.                  Lamp[vid] = 1;
  269.                  return 1;
  270.             }
  271.         }
  272.         if(IsSpu[vid] == 7)
  273.         {
  274.             if(Lamp[vid] == 1)
  275.             {
  276.                  DestroyObject(light[vid]);
  277.                  Lamp[vid] = 0;
  278.                  return 1;
  279.             }
  280.             if(Lamp[vid] == 0)
  281.             {
  282.                  light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
  283.                  AttachObjectToVehicle(light[vid], vid, 0.575378418, 0.786132812, 0.361483574, 0.0, 0.0, 0.0);
  284.                  Lamp[vid] = 1;
  285.                  return 1;
  286.             }
  287.         }
  288.         if(IsSpu[vid] == 8)
  289.         {
  290.             if(Lamp[vid] == 1)
  291.             {
  292.                  DestroyObject(light[vid]);
  293.                  Lamp[vid] = 0;
  294.                  return 1;
  295.             }
  296.             if(Lamp[vid] == 0)
  297.             {
  298.                  light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
  299.                  AttachObjectToVehicle(light[vid], vid, -0.455505371, -0.143066406, 0.861475945, 0.0, 0.0, 0.0);
  300.                  Lamp[vid] = 1;
  301.                  return 1;
  302.             }
  303.         }
  304.         return 1;
  305. }
Advertisement
Add Comment
Please, Sign In to add comment