OtaconEvil

[FS] Minigun in Patriot | BASE | By OTACON

Sep 29th, 2015
1,036
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  3.     *
  4.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  5.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  6.     *
  7.     * Codigo Creado Por OTACON
  8.     *
  9.     * CREDITOS:
  10.     *     OTACON: Realizacion y Idea de creacion del code.
  11.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  12.     *
  13.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  14.     *
  15.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  16.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  17. */
  18. /*
  19.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  20.     *
  21.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  22.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  23.     *
  24.     * Code Created By OTACON
  25.     *
  26.     * CREDITS:
  27.     *     OTACON: Idea Making and code creation.
  28.     *     YOUR: Modification freely respecting the above ;).
  29.     *
  30.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  31.     *
  32.     *                        FULLY spaces Theft Credit or
  33.     *                 Publication of this FILTERSCRIPT without my permission.
  34. */
  35.  
  36. /*
  37. https://www.youtube.com/watch?v=pVsT_183jbE
  38. */
  39.  
  40. #include <a_samp>
  41. native IsValidVehicle(vehicleid);
  42.  
  43. #define UPDATE_MINIGUN   (200)
  44. #define VEHICLE_MINIGUN  (470)
  45. #define IMPACT_MINIGUN   (18695)
  46. #define SMOKE_MINIGUN    (18696)
  47. #define WEAPPON_MINIGUN  (2985)
  48. #define MINIGUN_WEAPPON  (362)
  49. new MinigunPatriot[MAX_VEHICLES][9],
  50. UpdateMinigunPatriot2[MAX_PLAYERS];
  51.  
  52. public OnFilterScriptInit(){
  53.     AddPlayerClass(287,838.2986,-2056.6765,12.8672,262.0000,0,0,0,0,0,0); //testing
  54.     AddStaticVehicleEx ( VEHICLE_MINIGUN, 838.2986,-2056.6765,12.8672,262.0000, 0, 1, 30*60000 );
  55.    
  56.     for(new vehicleid=0; vehicleid<MAX_VEHICLES; vehicleid++){
  57.         if(GetVehicleModel(vehicleid)==VEHICLE_MINIGUN && IsValidVehicle(vehicleid)){
  58.             DestroyObject(MinigunPatriot[vehicleid][0]);
  59.             DestroyObject(MinigunPatriot[vehicleid][1]);
  60.             DestroyObject(MinigunPatriot[vehicleid][2]);
  61.             DestroyObject(MinigunPatriot[vehicleid][3]);
  62.             DestroyObject(MinigunPatriot[vehicleid][4]);
  63.             DestroyObject(MinigunPatriot[vehicleid][5]);
  64.             DestroyObject(MinigunPatriot[vehicleid][6]);
  65.             DestroyObject(MinigunPatriot[vehicleid][7]);
  66.             DestroyObject(MinigunPatriot[vehicleid][8]);
  67.             MinigunPatriot[vehicleid][0] = CreateObject(WEAPPON_MINIGUN,0,0,-1000,0,0,0,100);
  68.             MinigunPatriot[vehicleid][1] = CreateObject(IMPACT_MINIGUN,0,0,-1000,0,0,0,100);
  69.             MinigunPatriot[vehicleid][2] = CreateObject(SMOKE_MINIGUN,0,0,-1000,0,0,0,100);
  70.             MinigunPatriot[vehicleid][3] = CreateObject(MINIGUN_WEAPPON,0,0,-1000,0,0,0,100);
  71.             MinigunPatriot[vehicleid][4] = CreateObject(IMPACT_MINIGUN,0,0,-1000,0,0,0,100);
  72.             MinigunPatriot[vehicleid][5] = CreateObject(SMOKE_MINIGUN,0,0,-1000,0,0,0,100);
  73.             MinigunPatriot[vehicleid][6] = CreateObject(MINIGUN_WEAPPON,0,0,-1000,0,0,0,100);
  74.             MinigunPatriot[vehicleid][7] = CreateObject(IMPACT_MINIGUN,0,0,-1000,0,0,0,100);
  75.             MinigunPatriot[vehicleid][8] = CreateObject(SMOKE_MINIGUN,0,0,-1000,0,0,0,100);
  76.             AttachObjectToVehicle(MinigunPatriot[vehicleid][0], vehicleid, 0.300000,-2.025000,0.000000,0.000000,0.000000,-89.099983);
  77.             AttachObjectToVehicle(MinigunPatriot[vehicleid][1], vehicleid, 0.300000,-2.925001,-0.449999,0.000000,0.000000,178.199890);
  78.             AttachObjectToVehicle(MinigunPatriot[vehicleid][2], vehicleid, 0.225000,-3.000001,-0.375000,0.000000,0.000000,0.000000);
  79.             AttachObjectToVehicle(MinigunPatriot[vehicleid][3], vehicleid, 0.824999,0.750000,0.450000,-183.599884,29.700004,86.399986);
  80.             AttachObjectToVehicle(MinigunPatriot[vehicleid][4], vehicleid, 0.824999,1.950000,-0.899999,0.000000,0.000000,0.000000);
  81.             AttachObjectToVehicle(MinigunPatriot[vehicleid][5], vehicleid, 0.824999,2.025000,-0.824999,0.000000,0.000000,0.000000);
  82.             AttachObjectToVehicle(MinigunPatriot[vehicleid][6], vehicleid, -0.899999,0.750000,0.450000,-183.599884,29.700004,86.399986);
  83.             AttachObjectToVehicle(MinigunPatriot[vehicleid][7], vehicleid, -0.899999,1.950000,-0.899999,0.000000,0.000000,0.000000);
  84.             AttachObjectToVehicle(MinigunPatriot[vehicleid][8], vehicleid, -0.824999,2.025000,-0.824999,0.000000,0.000000,0.000000);
  85.         }
  86.     }
  87.     return true;
  88. }
  89.  
  90. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
  91.     new vehicleid = GetPlayerVehicleID(playerid);
  92.     new seatid = GetPlayerVehicleSeat(playerid);
  93.     if(newkeys & KEY_YES){
  94.         if(GetVehicleModel(vehicleid)==VEHICLE_MINIGUN && IsPlayerInAnyVehicle(playerid)){
  95.             KillTimer(UpdateMinigunPatriot2[playerid]);
  96.             UpdateMinigunPatriot2[playerid]=SetTimerEx("UpdateMinigunPatriot",UPDATE_MINIGUN,true,"ddd",playerid, seatid, vehicleid);
  97.         }
  98.     }
  99.     if(oldkeys & KEY_YES){
  100.         if(GetVehicleModel(vehicleid)==VEHICLE_MINIGUN && IsPlayerInAnyVehicle(playerid)){
  101.             KillTimer(UpdateMinigunPatriot2[playerid]);
  102.             switch(seatid){
  103.                 case 2,3:{DestroyObject(MinigunPatriot[vehicleid][1]); DestroyObject(MinigunPatriot[vehicleid][2]);}
  104.                 case 1:{DestroyObject(MinigunPatriot[vehicleid][4]); DestroyObject(MinigunPatriot[vehicleid][5]);}
  105.                 case 0:{DestroyObject(MinigunPatriot[vehicleid][7]); DestroyObject(MinigunPatriot[vehicleid][8]);}
  106.             }
  107.         }
  108.     }
  109.     return true;
  110. }
  111.  
  112. forward UpdateMinigunPatriot(playerid, seatid, vehicleid);
  113. public UpdateMinigunPatriot(playerid, seatid, vehicleid){
  114.     switch(seatid){
  115.         case 2,3:{
  116.             DestroyObject(MinigunPatriot[vehicleid][1]);
  117.             DestroyObject(MinigunPatriot[vehicleid][2]);
  118.             MinigunPatriot[vehicleid][1] = CreateObject(IMPACT_MINIGUN,0,0,-1000,0,0,0,100);
  119.             MinigunPatriot[vehicleid][2] = CreateObject(SMOKE_MINIGUN,0,0,-1000,0,0,0,100);
  120.             AttachObjectToVehicle(MinigunPatriot[vehicleid][1], vehicleid, 0.300000,-2.925001,-0.449999,0.000000,0.000000,178.199890);
  121.             AttachObjectToVehicle(MinigunPatriot[vehicleid][2], vehicleid, 0.225000,-3.000001,-0.375000,0.000000,0.000000,0.000000);
  122.         }case 1:{
  123.             DestroyObject(MinigunPatriot[vehicleid][4]);
  124.             DestroyObject(MinigunPatriot[vehicleid][5]);
  125.             MinigunPatriot[vehicleid][4] = CreateObject(IMPACT_MINIGUN,0,0,-1000,0,0,0,100);
  126.             MinigunPatriot[vehicleid][5] = CreateObject(SMOKE_MINIGUN,0,0,-1000,0,0,0,100);
  127.             AttachObjectToVehicle(MinigunPatriot[vehicleid][4], vehicleid, 0.824999,1.950000,-0.899999,0.000000,0.000000,0.000000);
  128.             AttachObjectToVehicle(MinigunPatriot[vehicleid][5], vehicleid, 0.824999,2.025000,-0.824999,0.000000,0.000000,0.000000);
  129.         }case 0:{
  130.             DestroyObject(MinigunPatriot[vehicleid][7]);
  131.             DestroyObject(MinigunPatriot[vehicleid][8]);
  132.             MinigunPatriot[vehicleid][7] = CreateObject(IMPACT_MINIGUN,0,0,-1000,0,0,0,100);
  133.             MinigunPatriot[vehicleid][8] = CreateObject(SMOKE_MINIGUN,0,0,-1000,0,0,0,100);
  134.             AttachObjectToVehicle(MinigunPatriot[vehicleid][7], vehicleid, -0.899999,1.950000,-0.899999,0.000000,0.000000,0.000000);
  135.             AttachObjectToVehicle(MinigunPatriot[vehicleid][8], vehicleid, -0.824999,2.025000,-0.824999,0.000000,0.000000,0.000000);
  136.         }
  137.     }
  138. }
RAW Paste Data