OtaconEvil

[FS] Luz, entre la vida y la muerte [BETA] By OTACON

Jan 13th, 2014
366
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. #define pressed(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  38. #define TIMER:%0(%1) forward%0(%1); public%0(%1)
  39.  
  40. enum mInfo{
  41.     bool:EstasMuriendo,
  42.     bool:EstasCaminando,
  43.     Float:DataMoribundo[3],
  44.     ObjetoMoribundo[2],
  45.     MatarMoribundo[2],
  46.     ContarMoribundo,
  47.     PlayerText:ContadorMoribundo, };
  48. new InfoMoribundo[MAX_PLAYERS][mInfo];
  49.  
  50. public OnPlayerSpawn(playerid){
  51.     PlayerTextDrawDestroy(playerid,InfoMoribundo[playerid][ContadorMoribundo]);
  52.     if(InfoMoribundo[playerid][EstasMuriendo]==true){
  53.         InfoMoribundo[playerid][ContadorMoribundo]=CreatePlayerTextDraw(playerid,554.000000, 396.000000, "_");
  54.         PlayerTextDrawAlignment(playerid,InfoMoribundo[playerid][ContadorMoribundo],2);
  55.         PlayerTextDrawBackgroundColor(playerid,InfoMoribundo[playerid][ContadorMoribundo],255);
  56.         PlayerTextDrawFont(playerid,InfoMoribundo[playerid][ContadorMoribundo],2);
  57.         PlayerTextDrawLetterSize(playerid,InfoMoribundo[playerid][ContadorMoribundo],0.220000,2.100000);
  58.         PlayerTextDrawColor(playerid,InfoMoribundo[playerid][ContadorMoribundo],-1);
  59.         PlayerTextDrawSetOutline(playerid,InfoMoribundo[playerid][ContadorMoribundo],1);
  60.         PlayerTextDrawSetProportional(playerid,InfoMoribundo[playerid][ContadorMoribundo],1);
  61.         PlayerTextDrawSetSelectable(playerid,InfoMoribundo[playerid][ContadorMoribundo],false);
  62.         TogglePlayerControllable(playerid,false);
  63.         SetPlayerHealth(playerid,10.0);
  64.         for(new time=0;time<2;time++) {KillTimer(InfoMoribundo[playerid][MatarMoribundo][time]);}
  65.         InfoMoribundo[playerid][ContarMoribundo]=40;
  66.         PlayerTextDrawShow(playerid,InfoMoribundo[playerid][ContadorMoribundo]);
  67.         InfoMoribundo[playerid][MatarMoribundo][1]=SetTimerEx("MoribundoDecidiendo",1*1000,true,"d",playerid);
  68.         SetPlayerPos(playerid,InfoMoribundo[playerid][DataMoribundo][0],InfoMoribundo[playerid][DataMoribundo][1],InfoMoribundo[playerid][DataMoribundo][2]);
  69.         for(new obj=0;obj<2;obj++) {DestroyPlayerObject(playerid,InfoMoribundo[playerid][ObjetoMoribundo][obj]);}
  70.         InfoMoribundo[playerid][ObjetoMoribundo][0]=CreatePlayerObject(playerid,18656,InfoMoribundo[playerid][DataMoribundo][0],InfoMoribundo[playerid][DataMoribundo][1],InfoMoribundo[playerid][DataMoribundo][2]+40.0+5,-90,0,0);
  71.         InfoMoribundo[playerid][ObjetoMoribundo][1]=CreatePlayerObject(playerid,19295,InfoMoribundo[playerid][DataMoribundo][0],InfoMoribundo[playerid][DataMoribundo][1],InfoMoribundo[playerid][DataMoribundo][2]+40.0,0,0,0);
  72.         SetPlayerCameraPos(playerid,InfoMoribundo[playerid][DataMoribundo][0],InfoMoribundo[playerid][DataMoribundo][1],InfoMoribundo[playerid][DataMoribundo][2]+5);
  73.         SetPlayerCameraLookAt(playerid,InfoMoribundo[playerid][DataMoribundo][0],InfoMoribundo[playerid][DataMoribundo][1],180);
  74.         for(new msg=0;msg<32;msg++) {SendClientMessage(playerid,-1," ");}
  75.         SendClientMessage(playerid,-1,"INFO: Usted se encuentra entre la vida y la muerte, ve hacia la luz o muere!.");
  76.     } return true;
  77. }
  78. public OnPlayerDeath(playerid, killerid, reason){
  79.     if(InfoMoribundo[playerid][EstasMuriendo]==false){
  80.         InfoMoribundo[playerid][EstasMuriendo]=true;
  81.         InfoMoribundo[playerid][EstasCaminando]=true;
  82.         GetPlayerPos(playerid,InfoMoribundo[playerid][DataMoribundo][0],InfoMoribundo[playerid][DataMoribundo][1],InfoMoribundo[playerid][DataMoribundo][2]);
  83.         SendClientMessage(playerid,-1,"INFO: Usted se encuentra entre la vida y la muerte, ve hacia la luz o muere!.");
  84.     } return true;
  85. }
  86. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
  87.     if(pressed(KEY_SPRINT) && InfoMoribundo[playerid][EstasMuriendo]==true){
  88.         new Float:position[3]; GetPlayerObjectPos(playerid,InfoMoribundo[playerid][ObjetoMoribundo][1],position[0],position[1],position[2]);
  89.         MovePlayerObject(playerid,InfoMoribundo[playerid][ObjetoMoribundo][1],position[0],position[1],position[2]-1,20);
  90.         if(position[2]<=12.316715 && InfoMoribundo[playerid][EstasCaminando]==true){
  91.             InfoMoribundo[playerid][EstasCaminando]=false;
  92.             KillTimer(InfoMoribundo[playerid][MatarMoribundo][1]);
  93.             InfoMoribundo[playerid][MatarMoribundo][1]=SetTimerEx("MoribundoViviendo",3*1000,true,"d",playerid);
  94.             for(new msg=0;msg<32;msg++) {SendClientMessage(playerid,-1," ");}
  95.             SendClientMessage(playerid,-1,"INFO: Usted ha llegado al final de la luz!.");
  96.         }
  97.     } return true;
  98. }
  99. TIMER: MoribundoViviendo(playerid){
  100.     InfoMoribundo[playerid][ContarMoribundo]=0;
  101.     InfoMoribundo[playerid][EstasMuriendo]=false;
  102.     InfoMoribundo[playerid][EstasCaminando]=false;
  103.     TogglePlayerControllable(playerid,true);
  104.     SetCameraBehindPlayer(playerid);
  105.     PlayerTextDrawHide(playerid,InfoMoribundo[playerid][ContadorMoribundo]);
  106.     for(new msg=0;msg<32;msg++) {SendClientMessage(playerid,-1," ");}
  107.     SendClientMessage(playerid,-1,"INFO: Usted ha decidido vivir, felicidades!.");
  108.     for(new obj=0;obj<2;obj++) {DestroyPlayerObject(playerid,InfoMoribundo[playerid][ObjetoMoribundo][obj]);}
  109.     for(new index=0;index<3;index++) {InfoMoribundo[playerid][DataMoribundo][index]=0;}
  110.     for(new time=0;time<2;time++) {KillTimer(InfoMoribundo[playerid][MatarMoribundo][time]);}
  111.     SetPlayerPos(playerid,-2661.7263,634.0160,14.4531); //hospital san fierro
  112.     SetPlayerHealth(playerid,100.0);
  113. }
  114. TIMER: MoribundoDecidiendo(playerid){
  115.     new data[40];
  116.     InfoMoribundo[playerid][ContarMoribundo]--;
  117.     format(data, sizeof(data), "~r~segundos restantes:~n~~w~00:00:%02d", InfoMoribundo[playerid][ContarMoribundo]);
  118.     PlayerTextDrawSetString(playerid,InfoMoribundo[playerid][ContadorMoribundo],data);
  119.     if(InfoMoribundo[playerid][ContarMoribundo]<=0){
  120.         InfoMoribundo[playerid][ContarMoribundo]=0;
  121.         InfoMoribundo[playerid][EstasMuriendo]=false;
  122.         InfoMoribundo[playerid][EstasCaminando]=false;
  123.         TogglePlayerControllable(playerid,true);
  124.         SetCameraBehindPlayer(playerid);
  125.         PlayerTextDrawHide(playerid,InfoMoribundo[playerid][ContadorMoribundo]);
  126.         for(new msg=0;msg<32;msg++) {SendClientMessage(playerid,-1," ");}
  127.         SendClientMessage(playerid,-1,"INFO: Usted ha decidido morir!.");
  128.         for(new obj=0;obj<2;obj++) {DestroyPlayerObject(playerid,InfoMoribundo[playerid][ObjetoMoribundo][obj]);}
  129.         for(new index=0;index<3;index++) {InfoMoribundo[playerid][DataMoribundo][index]=0;}
  130.         for(new time=0;time<2;time++) {KillTimer(InfoMoribundo[playerid][MatarMoribundo][time]);}
  131.         SetPlayerPos(playerid,825.5798,-1102.6852,25.7891); //cementerio los santos
  132.         SetPlayerHealth(playerid,100.0);
  133.     }
  134. }
  135.  
  136. //testing
  137. COMMAND:morir(playerid, params[]){
  138.     SetPlayerHealth(playerid,0.0);
  139.     return true;
  140. }
  141. /*
  142.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  143.     *
  144.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  145.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  146.     *
  147.     * Codigo Creado Por OTACON
  148.     *
  149.     * CREDITOS:
  150.     *     OTACON: Realizacion y Idea de creacion del code.
  151.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  152.     *
  153.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  154.     *
  155.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  156.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  157. */
  158. /*
  159.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  160.     *
  161.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  162.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  163.     *
  164.     * Code Created By OTACON
  165.     *
  166.     * CREDITS:
  167.     *     OTACON: Idea Making and code creation.
  168.     *     YOUR: Modification freely respecting the above ;).
  169.     *
  170.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  171.     *
  172.     *                        FULLY spaces Theft Credit or
  173.     *                 Publication of this FILTERSCRIPT without my permission.
  174. */
RAW Paste Data