Advertisement
OtaconEvil

[FS] Air Freight | By OTACON

Dec 20th, 2015
843
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.92 KB | None | 0 0
  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.  
  38.  
  39. */
  40.  
  41. #include <a_samp>
  42. #include <zcmd>
  43.  
  44. #define AIR_AUDIO "http://eccb.vd.aclst.com/dl.php/WMApCMp6IBY/Sonido+de+Avi%C3%83%C2%B3n.mp3?video_id=WMApCMp6IBY&t=V01BcENNcDZJQlktMzAzODI1NjI5MC0xNDUwNjIzNTAzLTk0Nzg4Ng%3D%3D&exp=23-12-2015&s=ec079a7f4c5706f019392592802a7ab1"
  45. #define AIR_DISTANCE 100.0
  46. #define AIR_MONEY (1000)
  47. enum air{
  48.     timer,
  49.     Float:pos[4],
  50.     container[3],
  51.     bool:active,
  52.     ttimer,
  53. };
  54. new AirFreight[MAX_PLAYERS][air];
  55.  
  56. COMMAND:container(playerid, params[]){
  57.     new data[200],Float:x,Float:y,Float:z,Float:a,Float:dist=AIR_DISTANCE;
  58.     format(data,sizeof(data),"INFO: usted debe esperar %d segundos para realizar un encargo!.",AirFreight[playerid][timer]-gettime());
  59.     //if(AirFreight[playerid][timer]>gettime()) return SendClientMessage(playerid,-1,data);
  60.     if(!AirFreight[playerid][active]){
  61.         //if(GetPlayerMoney(playerid)<AIR_MONEY) return SendClientMessage(playerid,-1,"INFO: usted no tiene suficiente dinero para solicitar un encargo!.");
  62.         GetPlayerPos(playerid,x,y,z);
  63.         GetPlayerFacingAngle(playerid,a);
  64.         AirFreight[playerid][pos][0]=x;
  65.         AirFreight[playerid][pos][1]=y;
  66.         AirFreight[playerid][pos][2]=z;
  67.         AirFreight[playerid][pos][3]=a;
  68.         AirFreight[playerid][active]=true;
  69.         DestroyObject(AirFreight[playerid][container][0]);
  70.         AirFreight[playerid][container][0]=CreateObject(18728,x,y,z-2,0,0,0);
  71.         SendClientMessage(playerid,-1,"INFO: coordenadas enviadas, exitosamente!.");
  72.         GameTextForPlayer(playerid,"~w~coordenadas~n~~g~enviadas!",3000,3);
  73.     }else{
  74.         AirFreight[playerid][timer]=gettime()+60;
  75.         StopAudioStreamForPlayer(playerid);
  76.         x=AirFreight[playerid][pos][0];
  77.         y=AirFreight[playerid][pos][1];
  78.         z=AirFreight[playerid][pos][2];
  79.         a=AirFreight[playerid][pos][3];
  80.         DestroyObject(AirFreight[playerid][container][1]);
  81.         AirFreight[playerid][container][1]=CreateObject(2935,x,y,z+100,0,0,a-90);
  82.         SendClientMessage(playerid,-1,"INFO: el encargo ha sido enviado a su posicion, envio en proceso!.");
  83.         GameTextForPlayer(playerid,"~w~envio en~n~~y~proceso...",3000,3);
  84.         DestroyObject(AirFreight[playerid][container][0]);
  85.         switch(random(10)){
  86.             case 0..6:{
  87.                 PlayAudioStreamForPlayer(playerid,AIR_AUDIO,x,y,z,dist,1);
  88.                 MoveObject(AirFreight[playerid][container][1],x,y,z+0.5,12);
  89.                 SendClientMessage(playerid,-1,"INFO: el encargo ha sido enviado a su posicion, envio exitoso!.");
  90.             }
  91.             case 7..9:{
  92.                 GameTextForPlayer(playerid,"~r~envio~n~~r~fallido!",3000,3);
  93.                 SendClientMessage(playerid,-1,"INFO: el avion que transportaba su encargo ha sufrido un accidente, envio fallido!.");
  94.                 // lean
  95.                 StopAudioStreamForPlayer(playerid);
  96.                 DestroyObject(AirFreight[playerid][container][0]);
  97.                 DestroyObject(AirFreight[playerid][container][1]);
  98.                 DestroyObject(AirFreight[playerid][container][2]);
  99.                 AirFreight[playerid][pos][0]=0.0;
  100.                 AirFreight[playerid][pos][1]=0.0;
  101.                 AirFreight[playerid][pos][2]=0.0;
  102.                 AirFreight[playerid][pos][3]=0.0;
  103.                 AirFreight[playerid][active]=false;
  104.                 KillTimer(AirFreight[playerid][ttimer]);
  105.             }
  106.         }
  107.     }
  108.     return true;
  109. }
  110.  
  111. forward asd(playerid);
  112. public asd(playerid){
  113.     new Float:x,Float:y,Float:z,Float:a;
  114.     x=AirFreight[playerid][pos][0];
  115.     y=AirFreight[playerid][pos][1];
  116.     z=AirFreight[playerid][pos][2];
  117.     a=AirFreight[playerid][pos][3];
  118.     DestroyObject(AirFreight[playerid][container][1]);
  119.     CreateVehicle(car_random(),x,y,z,a,random(200),random(200),-1);
  120.     // lean
  121.     StopAudioStreamForPlayer(playerid);
  122.     DestroyObject(AirFreight[playerid][container][0]);
  123.     DestroyObject(AirFreight[playerid][container][1]);
  124.     DestroyObject(AirFreight[playerid][container][2]);
  125.     AirFreight[playerid][pos][0]=0.0;
  126.     AirFreight[playerid][pos][1]=0.0;
  127.     AirFreight[playerid][pos][2]=0.0;
  128.     AirFreight[playerid][pos][3]=0.0;
  129.     AirFreight[playerid][active]=false;
  130.     KillTimer(AirFreight[playerid][ttimer]);
  131. }
  132.  
  133. public OnObjectMoved(objectid){
  134.     for(new playerid=0, p=GetPlayerPoolSize(); playerid<=p; playerid++){
  135.         if(!IsPlayerConnected(playerid))continue;
  136.         if(objectid == AirFreight[playerid][container][1]){//weapon
  137.             new Float:x,Float:y,Float:z,Float:dist=AIR_DISTANCE;
  138.             x=AirFreight[playerid][pos][0];
  139.             y=AirFreight[playerid][pos][1];
  140.             z=AirFreight[playerid][pos][2];
  141.             GameTextForPlayer(playerid,"~w~envio~n~~g~recibido!",3000,3);
  142.             KillTimer(AirFreight[playerid][ttimer]);
  143.             AirFreight[playerid][ttimer]=SetTimerEx("asd",5000,false,"i",playerid);
  144.             AirFreight[playerid][container][2]=CreateObject(18671,x,y,z-2,0,0,0);
  145.             CreateExplosion(x,y,z,8,dist);
  146.         }
  147.     }
  148.     return true;
  149. }
  150.  
  151. stock car_random(){
  152.     new car;
  153.     new rand=random(612);
  154.     switch(rand){
  155.         case 400..611:car=rand;
  156.         default:car=400;
  157.     }
  158.     return car;
  159. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement