OtaconEvil

[FS] Vehículo DFT-30 con la caja de carga - By OTACON

Jan 25th, 2014
694
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. #include <a_samp>
  36. #include <zcmd>
  37.  
  38. /*
  39.     NOTA: tiene un bug de que se ven los objetos sobre puestos, pero lo pueden reparar habilitando los AttachObjectToVehicle  que estas desabilitados en el code y desabilitando los habilitados correspondiente, pero haciendo eso se haga mas grande la caja del vehiculo.
  40.  
  41.     NOTE: has a bug that the objects are placed, but can be repaired by enabling AttachObjectToVehicle these disabilities as disabling the code and the corresponding enabled, but doing that box gets bigger vehicle.
  42. */
  43.  
  44. #define MAX_OBJ (10)
  45. static CajaCarro[MAX_VEHICLES][MAX_OBJ],
  46. bool:UsandoCajaCarro[MAX_VEHICLES];
  47.  
  48. COMMAND:caja(playerid, params[]) {
  49.     new vehicleid = GetPlayerVehicleID(playerid);
  50.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1," [ ! ] no estas en un vehiculo!.");
  51.     if(GetVehicleModel(vehicleid)!=578) return SendClientMessage(playerid,-1," [ ! ] no estas en un vehiculo modelo DFT-30!.");
  52.     switch(GetVehicleModel(vehicleid)) {
  53.         case 578: {
  54.             switch(UsandoCajaCarro[vehicleid]) {
  55.                 case false: {
  56.                     UsandoCajaCarro[vehicleid]=true;
  57.                     DestroyObject(CajaCarro[vehicleid][7]);
  58.                     CajaCarro[vehicleid][7]=CreateObject(19369, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  59.                     AttachObjectToVehicle(CajaCarro[vehicleid][7], vehicleid, 0.0, -7.3, -0.9, 0.0, 70.0, 90.0);
  60.                     //AttachObjectToVehicle(CajaCarro[vehicleid][7], vehicleid, 0.0, -8.7, -0.9, 0.0, 70.0, 90.0);
  61.                     SetObjectMaterial(CajaCarro[vehicleid][7], 0, 578, "dft30", "dft3092flatbed128", -1);
  62.                 }
  63.                 case true: {
  64.                     UsandoCajaCarro[vehicleid]=false;
  65.                     DestroyObject(CajaCarro[vehicleid][7]);
  66.                     CajaCarro[vehicleid][7]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  67.                     AttachObjectToVehicle(CajaCarro[vehicleid][7], vehicleid, 0.0, -5.8, 0.5, 90.0, 0.0, 90.0);
  68.                     SetObjectMaterial(CajaCarro[vehicleid][7], 0, 578, "dft30", "dft3092flatbed128", -1);
  69.                 }
  70.             }
  71.         }
  72.     } return true;
  73. }
  74. public OnFilterScriptInit() {
  75.     // ###### TESTING ######
  76.     AddPlayerClass(145,1274.2706,-1339.6691,13.6777,262.0000,0,0,0,0,0,0); //
  77.     AddStaticVehicleEx(575, 1260.2792, -1369.4493, 13.8190, 0.0000, random(200), random(200), 999999);
  78.     AddStaticVehicleEx(578, 1260.4554, -1336.7083, 13.9903, 0.0000, random(200), random(200), 999999);
  79.     // ###### TESTING ######
  80.     for(new vehicleid=0; vehicleid<MAX_VEHICLES; vehicleid++) {
  81.         switch(GetVehicleModel(vehicleid)) {
  82.             case 578: {
  83.                 UsandoCajaCarro[vehicleid]=false;
  84.                 CajaCarro[vehicleid][0]=CreateObject(19369, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  85.                 CajaCarro[vehicleid][8]=CreateObject(19369, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  86.                 CajaCarro[vehicleid][9]=CreateObject(19369, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  87.                 CajaCarro[vehicleid][1]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  88.                 CajaCarro[vehicleid][2]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  89.                 CajaCarro[vehicleid][3]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  90.                 CajaCarro[vehicleid][4]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  91.                 /*
  92.                 AttachObjectToVehicle(CajaCarro[vehicleid][5], vehicleid, 1.7, -5.8, 0.5, 90.0, 0.0, 0.0);
  93.                 AttachObjectToVehicle(CajaCarro[vehicleid][6], vehicleid, -1.7, -5.8, 0.5, 90.0, 0.0, 0.0);
  94.                 */
  95.                 CajaCarro[vehicleid][5]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  96.                 CajaCarro[vehicleid][6]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  97.                 /*
  98.                 AttachObjectToVehicle(CajaCarro[vehicleid][7], vehicleid, 0.0, -7.6, 0.5, 90.0, 0.0, 90.0);
  99.                 */
  100.                 CajaCarro[vehicleid][7]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  101.                 AttachObjectToVehicle(CajaCarro[vehicleid][0], vehicleid, 0.0, -2.5, -0.3, 0.0, 90.0, 0.0);
  102.                 AttachObjectToVehicle(CajaCarro[vehicleid][8], vehicleid, 0.0, 0.7, -0.3, 0.0, 90.0, 0.0);
  103.                 AttachObjectToVehicle(CajaCarro[vehicleid][9], vehicleid, 0.0, -4.0, -0.3, 0.0, 90.0, 0.0);
  104.                 AttachObjectToVehicle(CajaCarro[vehicleid][1], vehicleid, 1.7, -2.5, 0.5, 90.0, 0.0, 0.0);
  105.                 AttachObjectToVehicle(CajaCarro[vehicleid][2], vehicleid, -1.7, -2.5, 0.5, 90.0, 0.0, 0.0);
  106.                 AttachObjectToVehicle(CajaCarro[vehicleid][3], vehicleid, 1.7, 0.8, 0.5, 90.0, 0.0, 0.0);
  107.                 AttachObjectToVehicle(CajaCarro[vehicleid][4], vehicleid, -1.7, 0.8, 0.5, 90.0, 0.0, 0.0);
  108.                 AttachObjectToVehicle(CajaCarro[vehicleid][5], vehicleid, 1.7, -4.0, 0.5, 90.0, 0.0, 0.0);
  109.                 AttachObjectToVehicle(CajaCarro[vehicleid][6], vehicleid, -1.7, -4.0, 0.5, 90.0, 0.0, 0.0);
  110.                 AttachObjectToVehicle(CajaCarro[vehicleid][7], vehicleid, 0.0, -5.8, 0.5, 90.0, 0.0, 90.0);
  111.                 for(new index=0; index<10; index++) SetObjectMaterial(CajaCarro[vehicleid][index], 0, 578, "dft30", "dft3092flatbed128", -1);
  112.             }
  113.         }
  114.     } return true;
  115. }
  116. public OnVehicleSpawn(vehicleid) {
  117.     switch(GetVehicleModel(vehicleid)) {
  118.         case 578: {
  119.             for(new index=0; index<10; index++) \
  120.                 DestroyObject(CajaCarro[vehicleid][index]);
  121.             UsandoCajaCarro[vehicleid]=false;
  122.             CajaCarro[vehicleid][0]=CreateObject(19369, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  123.             CajaCarro[vehicleid][8]=CreateObject(19369, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  124.             CajaCarro[vehicleid][9]=CreateObject(19369, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  125.             CajaCarro[vehicleid][1]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  126.             CajaCarro[vehicleid][2]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  127.             CajaCarro[vehicleid][3]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  128.             CajaCarro[vehicleid][4]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  129.             CajaCarro[vehicleid][5]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  130.             CajaCarro[vehicleid][6]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  131.             CajaCarro[vehicleid][7]=CreateObject(19435, 0.00000, 0.00000, 0.00000,   0.00000, 0.00000, 0.00000);
  132.             AttachObjectToVehicle(CajaCarro[vehicleid][0], vehicleid, 0.0, -2.5, -0.3, 0.0, 90.0, 0.0);
  133.             AttachObjectToVehicle(CajaCarro[vehicleid][8], vehicleid, 0.0, 0.7, -0.3, 0.0, 90.0, 0.0);
  134.             AttachObjectToVehicle(CajaCarro[vehicleid][9], vehicleid, 0.0, -4.0, -0.3, 0.0, 90.0, 0.0);
  135.             AttachObjectToVehicle(CajaCarro[vehicleid][1], vehicleid, 1.7, -2.5, 0.5, 90.0, 0.0, 0.0);
  136.             AttachObjectToVehicle(CajaCarro[vehicleid][2], vehicleid, -1.7, -2.5, 0.5, 90.0, 0.0, 0.0);
  137.             AttachObjectToVehicle(CajaCarro[vehicleid][3], vehicleid, 1.7, 0.8, 0.5, 90.0, 0.0, 0.0);
  138.             AttachObjectToVehicle(CajaCarro[vehicleid][4], vehicleid, -1.7, 0.8, 0.5, 90.0, 0.0, 0.0);
  139.             /*
  140.             AttachObjectToVehicle(CajaCarro[vehicleid][5], vehicleid, 1.7, -5.8, 0.5, 90.0, 0.0, 0.0);
  141.             AttachObjectToVehicle(CajaCarro[vehicleid][6], vehicleid, -1.7, -5.8, 0.5, 90.0, 0.0, 0.0);
  142.             */
  143.             AttachObjectToVehicle(CajaCarro[vehicleid][5], vehicleid, 1.7, -4.0, 0.5, 90.0, 0.0, 0.0);
  144.             AttachObjectToVehicle(CajaCarro[vehicleid][6], vehicleid, -1.7, -4.0, 0.5, 90.0, 0.0, 0.0);
  145.             /*
  146.             AttachObjectToVehicle(CajaCarro[vehicleid][7], vehicleid, 0.0, -7.6, 0.5, 90.0, 0.0, 90.0);
  147.             */
  148.             AttachObjectToVehicle(CajaCarro[vehicleid][7], vehicleid, 0.0, -5.8, 0.5, 90.0, 0.0, 90.0);
  149.             for(new index=0; index<10; index++) \
  150.                 SetObjectMaterial(CajaCarro[vehicleid][index], 0, 578, "dft30", "dft3092flatbed128", -1);
  151.         }
  152.     } return true;
  153. }
  154. public OnVehicleDeath(vehicleid, killerid) {
  155.     switch(GetVehicleModel(vehicleid)) {
  156.         case 578: {
  157.             UsandoCajaCarro[vehicleid]=false;
  158.             for(new index=0; index<10; index++) \
  159.                 DestroyObject(CajaCarro[vehicleid][index]);
  160.         }
  161.     } return true;
  162. }
RAW Paste Data