OtaconEvil

[FS] simple system of ironman | By OTACON

Nov 7th, 2015
570
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.  
  38. www.youtube.com/watch?v=L9eeGB2zQss
  39.  
  40. */
  41.  
  42. #include <a_samp>
  43. #include <zcmd>
  44.  
  45. enum jarvis {
  46.     bool:ActivarIronman,
  47.     bool:IronmanVolando,
  48.     MatarIronman[2],
  49.     Float:TurbinasIronman,
  50.     Float:EnergiaIronman[2],
  51.     VestimentaTony, };
  52. new Ironman[MAX_PLAYERS][jarvis];
  53.  
  54. COMMAND:ironman(playerid, params[]) {
  55.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return false;
  56.     if(!Ironman[playerid][ActivarIronman]) {
  57.         SetPlayerArmedWeapon(playerid,0);
  58.         Ironman[playerid][TurbinasIronman] = 1.0;
  59.         new Float:Health[2]; GetPlayerHealth(playerid,Health[0]);
  60.         GetPlayerArmour(playerid, Health[1]);
  61.         Ironman[playerid][EnergiaIronman][0] = Health[0];
  62.         Ironman[playerid][EnergiaIronman][1] = Health[1];
  63.         Ironman[playerid][VestimentaTony] = GetPlayerSkin(playerid);
  64.         SetPlayerHealth(playerid, (Float:0x7F800000));
  65.         SetPlayerArmour(playerid, (Float:0x7F800000));
  66.         SetPlayerSkin(playerid, 3);
  67.         SetPlayerVelocity(playerid, 0, 0, 0);
  68.         Ironman[playerid][IronmanVolando]=false;
  69.         Ironman[playerid][ActivarIronman] = true;
  70.         KillTimer(Ironman[playerid][MatarIronman][0]);
  71.         Ironman[playerid][MatarIronman][0] = SetTimerEx("UpdateJarvisIronman", 500, true, "d", playerid);
  72.         //SendClientMessage(playerid, -1, "JARVIS: Señor, usted se ha colocado el traje 'Ironman'!.");
  73.         ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
  74.         for(new index=0; index<6; index++) { RemovePlayerAttachedObject(playerid,index); }
  75.     } else {
  76.         Ironman[playerid][TurbinasIronman] = -1;
  77.         SetPlayerHealth(playerid, Ironman[playerid][EnergiaIronman][0]);
  78.         SetPlayerArmour(playerid, Ironman[playerid][EnergiaIronman][1]);
  79.         SetPlayerSkin(playerid, Ironman[playerid][VestimentaTony]);
  80.         SetPlayerVelocity(playerid, 0, 0, 0);
  81.         Ironman[playerid][IronmanVolando]=false;
  82.         Ironman[playerid][ActivarIronman] = false;
  83.         KillTimer(Ironman[playerid][MatarIronman][0]);
  84.         //SendClientMessage(playerid, -1, "JARVIS: Señor, usted se ha quitado el traje 'Ironman'!.");
  85.         ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
  86.         for(new index=0; index<6; index++) { RemovePlayerAttachedObject(playerid,index); }
  87.     }
  88.     return true;
  89. }
  90.  
  91. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
  92.     if(newkeys & KEY_FIRE && Ironman[playerid][ActivarIronman]) {
  93.         new Float:explosiones[3];
  94.         GetPlayerPos(playerid, explosiones[0],explosiones[1],explosiones[2]);
  95.         CreateExplosion(explosiones[0],explosiones[1],explosiones[2], 1, 10.0);
  96.         //SendClientMessage(playerid, -1, "JARVIS: Señor, explosion aerea activada!.");
  97.     }
  98.     return true;
  99. }
  100.  
  101. forward UpdateJarvisIronman(playerid);
  102. public UpdateJarvisIronman(playerid) {
  103.     if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return false;
  104.     static teclasjarvis[3], Float:PosicionJarvis[2][3];
  105.     GetPlayerKeys(playerid,teclasjarvis[0],teclasjarvis[1],teclasjarvis[2]);
  106.     if(teclasjarvis[0] & KEY_SPRINT && Ironman[playerid][ActivarIronman] == true) {
  107.         GetPlayerCameraPos(playerid, PosicionJarvis[1][0],PosicionJarvis[1][1],PosicionJarvis[1][2]);
  108.         GetPlayerCameraFrontVector(playerid, PosicionJarvis[0][0],PosicionJarvis[0][1],PosicionJarvis[0][2]);
  109.         SetPlayerToFacePos(playerid, PosicionJarvis[0][0] + PosicionJarvis[1][0], PosicionJarvis[0][1]+PosicionJarvis[1][1]);
  110.         SetPlayerVelocity(playerid, PosicionJarvis[0][0]*Ironman[playerid][TurbinasIronman], PosicionJarvis[0][1]*Ironman[playerid][TurbinasIronman], PosicionJarvis[0][2]*Ironman[playerid][TurbinasIronman]);
  111.         ApplyAnimation(playerid,"PARACHUTE","FALL_SkyDive_Accel",4.1,1,1,1,1,0);
  112.         if(Ironman[playerid][IronmanVolando]==false) {
  113.         Ironman[playerid][IronmanVolando]=true;
  114.         for(new index=0; index<6; index++) { RemovePlayerAttachedObject(playerid,index); }
  115.         SetPlayerAttachedObject(playerid,0,18693,5,-1.506999,-0.032999,-0.153000,0.000000,85.599983,18.500005,1.000000,1.000000,1.000000,0xFFEEEEEE);
  116.         SetPlayerAttachedObject(playerid,1,18693,6,-1.267001,-0.454000,0.636999,33.200012,119.699867,-67.900016,1.000000,1.000000,1.000000,0xFFEEEEEE);
  117.         SetPlayerAttachedObject(playerid,2,18693,9,-1.418004,0.019999,0.076999,-61.300003,89.999954,-2.700009,1.000000,1.000000,1.000000,0xFFEEEEEE);
  118.         SetPlayerAttachedObject(playerid,3,18693,10,-1.418004,0.019999,0.076999,-61.300003,89.999954,-2.700009,1.000000,1.000000,1.000000,0xFFEEEEEE);
  119.         SetPlayerAttachedObject(playerid,4,18730,5,-1.506999,-0.032999,-0.153000,0.000000,85.599983,18.500005,1.000000,1.000000,1.000000,0xFFEEEEEE);
  120.         SetPlayerAttachedObject(playerid,5,18730,6,-1.267001,-0.454000,0.636999,33.200012,119.699867,-67.900016,1.000000,1.000000,1.000000,0xFFEEEEEE); }
  121.     } else {
  122.         if(Ironman[playerid][IronmanVolando]==true) {
  123.         for(new index=0; index<6; index++) { RemovePlayerAttachedObject(playerid,index); }
  124.         Ironman[playerid][IronmanVolando]=false;
  125.         SetPlayerVelocity(playerid, 0, 0, 0);
  126.         ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0); }
  127.     }
  128.     return true;
  129. }
  130.  
  131. forward Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
  132. public Float:SetPlayerToFacePos(playerid, Float:X, Float:Y){
  133.     new Float:pX, Float:pY, Float:pZ, Float:ang;
  134.     if(!IsPlayerConnected(playerid)) return 0.0;
  135.     GetPlayerPos(playerid, pX, pY, pZ);
  136.     if( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  137.     else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
  138.     else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  139.     if(X > pX) ang = (floatabs(floatabs(ang) + 180.0));
  140.     else ang = (floatabs(ang) - 180.0);
  141.     ang += 180.0;
  142.     SetPlayerFacingAngle(playerid, ang);
  143.     return ang;
  144. }
RAW Paste Data