Advertisement
Graf_Spee

[FS] gDamage

Aug 7th, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 20.05 KB | None | 0 0
  1. /* INCLUDES */
  2.  
  3. #include    <a_samp>
  4. #include    <ZCMD>
  5. #include    <DOF2>
  6.  
  7. /* DEFINES */
  8.  
  9. /* Cores */
  10.  
  11. #define     AzulClaro           0x1E90FFFF
  12. #define     AzulCiano           0x00FFFFFF
  13. #define     VerdeClaro          0x00FA9AFF
  14. #define     Amarelo             0xFFFF00FF
  15. #define     Vermelho            0xFF0000FF
  16.  
  17. /* Dialogs */
  18.  
  19. #define     DIALOG_CERTEZA      1
  20. #define     DIALOG_ESCOLHERARMA 2
  21.  
  22. /* Outros */
  23.  
  24. #define     File                "gDamage/%s.txt"
  25. #define     TAMANHO_OBJETO      0.4
  26.  
  27. /* OUTROS */
  28.  
  29.  
  30. enum pInfo
  31. {
  32.     gPower, //DESATIVADA POR MOMENTO (ATÉ A PRÓXIMA ATUALIZAÇÃO)
  33.     gHabilidade9mm,
  34.     gHabilidadeSilenced,
  35.     gHabilidadeEagle,
  36.     gHabilidadeShotgun,
  37.     gHabilidadeSawnoff,
  38.     gHabilidadeCombatShotgun,
  39.     gHabilidadeUzi,
  40.     gHabilidadeMP5,
  41.     gHabilidadeAK47,
  42.     gHabilidadeM4,
  43.     gHabilidadeTec9,
  44.     gHabilidadeCountryRifle, //DESATIVADA POR MOMENTO (ATÉ A PRÓXIMA ATUALIZAÇÃO)
  45.     gHabilidadeSniperRifle, //DESATIVADA POR MOMENTO (ATÉ A PRÓXIMA ATUALIZAÇÃO)
  46.     //
  47.     gSkill9mm,
  48.     gSkillSawnoff,
  49.     gSkillUzi
  50. }
  51.  
  52. /* NEW'S */
  53.  
  54. new PlayerInfo[MAX_PLAYERS][pInfo];
  55. new pAvisado[MAX_PLAYERS] = 0;
  56. new Float:X_OBJETO  =       2805.8999000;
  57. new Float:Y_OBJETO  =       -2337.0000000;
  58.  
  59. new bool:QuerendoTreinar[MAX_PLAYERS];
  60. new bool:pAtirou[MAX_PLAYERS];
  61. new bool:pTreinando[MAX_PLAYERS];
  62.  
  63. /* FORWARDS */
  64.  
  65. forward Liberar(playerid);
  66.  
  67. /* PUBLICS */
  68.  
  69. public Liberar(playerid)
  70. {
  71.     pAtirou[playerid] = false;
  72.     pAvisado[playerid] = 0;
  73.     return 1;
  74. }
  75.  
  76. public OnFilterScriptInit()
  77. {
  78.     print("\n--------------------------------------");
  79.     print(" gDamage");
  80.     print("--------------------------------------\n");
  81.     CreateObject(3025,2805.8999000,-2337.0000000,16.2000000,0.0000000,0.0000000,270.0000000); //object(target_frame) (2)
  82.     CreateObject(2619,2805.8000500,-2337.0000000,15.5000000,0.0000000,0.0000000,0.0000000); //object(mp_ammoambient) (2)
  83.     return 1;
  84. }
  85.  
  86. public OnFilterScriptExit()
  87. {
  88.     DOF2_Exit();
  89.     return 1;
  90. }
  91.  
  92. public OnPlayerConnect(playerid)
  93. {
  94.     new Salvamento[24];
  95.     format(Salvamento, 24, File, GetPlayerNameEx(playerid));
  96.     //
  97.     if(!DOF2_FileExists(Salvamento))
  98.     {
  99.         DOF2_CreateFile(Salvamento);
  100.         DOF2_SetInt(Salvamento, "Força", 0);
  101.         DOF2_SetInt(Salvamento, "Habilidade 9mm", 0);
  102.         DOF2_SetInt(Salvamento, "Habilidade Silenciada", 0);
  103.         DOF2_SetInt(Salvamento, "Habilidade Eagle", 0);
  104.         DOF2_SetInt(Salvamento, "Habilidade Shotgun", 0);
  105.         DOF2_SetInt(Salvamento, "Habilidade Sawnoff", 0);
  106.         DOF2_SetInt(Salvamento, "Habilidade Combat Shotgun", 0);
  107.         DOF2_SetInt(Salvamento, "Habilidade Uzi", 0);
  108.         DOF2_SetInt(Salvamento, "Habilidade MP5", 0);
  109.         DOF2_SetInt(Salvamento, "Habilidade AK-47", 0);
  110.         DOF2_SetInt(Salvamento, "Habilidade M4", 0);
  111.         DOF2_SetInt(Salvamento, "Habilidade Tec-9", 0);
  112.         DOF2_SetInt(Salvamento, "Habilidade Country Rifle", 0);
  113.         DOF2_SetInt(Salvamento, "Habilidade Sniper Rifle", 0);
  114.         //
  115.         // O Nível de cada arma vai de 0 a 999 (começando a partir do 0) e é aumentado cada vez que o Player matar usando aquela arma.
  116.         DOF2_SetInt(Salvamento, "Skill 9mm", 0);
  117.         DOF2_SetInt(Salvamento, "Skill Sawnoff", 0);
  118.         DOF2_SetInt(Salvamento, "Skill Uzi", 0);
  119.         SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 0);
  120.         SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 0);
  121.         SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 0);
  122.         DOF2_SaveFile();
  123.     }
  124.     PlayerInfo[playerid][gPower] = DOF2_GetInt(Salvamento, "Força");
  125.     PlayerInfo[playerid][gHabilidade9mm] = DOF2_GetInt(Salvamento, "Habilidade 9mm");
  126.     PlayerInfo[playerid][gHabilidadeEagle] = DOF2_GetInt(Salvamento, "Habilidade Eagle");
  127.     PlayerInfo[playerid][gHabilidadeShotgun] = DOF2_GetInt(Salvamento, "Habilidade Shotgun");
  128.     PlayerInfo[playerid][gHabilidadeSilenced] = DOF2_GetInt(Salvamento, "Habilidade Silenciada");
  129.     PlayerInfo[playerid][gHabilidadeSawnoff] = DOF2_GetInt(Salvamento, "Habilidade Sawnoff");
  130.     PlayerInfo[playerid][gHabilidadeCombatShotgun] = DOF2_GetInt(Salvamento, "Habilidade Combat Shotgun");
  131.     PlayerInfo[playerid][gHabilidadeUzi] = DOF2_GetInt(Salvamento, "Habilidade Uzi");
  132.     PlayerInfo[playerid][gHabilidadeMP5] = DOF2_GetInt(Salvamento, "Habilidade MP5");
  133.     PlayerInfo[playerid][gHabilidadeAK47] = DOF2_GetInt(Salvamento, "Habilidade AK-47");
  134.     PlayerInfo[playerid][gHabilidadeM4] = DOF2_GetInt(Salvamento, "Habilidade M4");
  135.     PlayerInfo[playerid][gHabilidadeTec9] = DOF2_GetInt(Salvamento, "Habilidade Tec-9");
  136.     PlayerInfo[playerid][gHabilidadeCountryRifle] = DOF2_GetInt(Salvamento, "Habilidade Country Rifle");
  137.     PlayerInfo[playerid][gHabilidadeSniperRifle] = DOF2_GetInt(Salvamento, "Habilidade Sniper Rifle");
  138.     //
  139.     PlayerInfo[playerid][gSkill9mm] = DOF2_GetInt(Salvamento, "Skill 9mm");
  140.     PlayerInfo[playerid][gSkillSawnoff] = DOF2_GetInt(Salvamento, "Skill Sawnoff");
  141.     PlayerInfo[playerid][gSkillUzi] = DOF2_GetInt(Salvamento, "Skill Uzi");
  142.     //
  143.     SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, PlayerInfo[playerid][gSkill9mm]);
  144.     SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, PlayerInfo[playerid][gSkillSawnoff]);
  145.     SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, PlayerInfo[playerid][gSkillUzi]);
  146.     return 1;
  147. }
  148.  
  149. public OnPlayerDisconnect(playerid, reason)
  150. {
  151.     new Salvamento[24];
  152.     format(Salvamento, 24, File, GetPlayerNameEx(playerid));
  153.     //
  154.     if(!DOF2_FileExists(Salvamento))
  155.     {
  156.         DOF2_CreateFile(Salvamento);
  157.     }
  158.     //
  159.     DOF2_SetInt(Salvamento, "Força", gPower);
  160.     DOF2_SetInt(Salvamento, "Habilidade 9mm", PlayerInfo[playerid][gHabilidade9mm]);
  161.     DOF2_SetInt(Salvamento, "Habilidade Silenciada", PlayerInfo[playerid][gHabilidadeSilenced]);
  162.     DOF2_SetInt(Salvamento, "Habilidade Eagle", PlayerInfo[playerid][gHabilidadeEagle]);
  163.     DOF2_SetInt(Salvamento, "Habilidade Shotgun", PlayerInfo[playerid][gHabilidadeShotgun]);
  164.     DOF2_SetInt(Salvamento, "Habilidade Sawnoff", PlayerInfo[playerid][gHabilidadeSawnoff]);
  165.     DOF2_SetInt(Salvamento, "Habilidade Combat Shotgun", PlayerInfo[playerid][gHabilidadeCombatShotgun]);
  166.     DOF2_SetInt(Salvamento, "Habilidade Uzi", PlayerInfo[playerid][gHabilidadeUzi]);
  167.     DOF2_SetInt(Salvamento, "Habilidade MP5", PlayerInfo[playerid][gHabilidadeMP5]);
  168.     DOF2_SetInt(Salvamento, "Habilidade AK-47", PlayerInfo[playerid][gHabilidadeAK47]);
  169.     DOF2_SetInt(Salvamento, "Habilidade M4", PlayerInfo[playerid][gHabilidadeM4]);
  170.     DOF2_SetInt(Salvamento, "Habilidade Tec-9", PlayerInfo[playerid][gHabilidadeTec9]);
  171.     DOF2_SetInt(Salvamento, "Habilidade Country Rifle", PlayerInfo[playerid][gHabilidadeCountryRifle]);
  172.     DOF2_SetInt(Salvamento, "Habilidade Sniper Rifle", PlayerInfo[playerid][gHabilidadeSniperRifle]);
  173.     //
  174.     DOF2_SetInt(Salvamento, "Skill 9mm", PlayerInfo[playerid][gSkill9mm]);
  175.     DOF2_SetInt(Salvamento, "Skill Sawnoff", PlayerInfo[playerid][gSkillSawnoff]);
  176.     DOF2_SetInt(Salvamento, "Skill Uzi", PlayerInfo[playerid][gSkillUzi]);
  177.     DOF2_SaveFile();
  178.     return 1;
  179. }
  180.  
  181. public OnPlayerDeath(playerid, killerid, reason)
  182. {
  183.     if(killerid != INVALID_PLAYER_ID)
  184.     {
  185.         if(reason == 22)
  186.         {
  187.             PlayerInfo[killerid][gSkill9mm]++;
  188.             SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, PlayerInfo[playerid][gSkill9mm]);
  189.         }
  190.         if(reason == 26)
  191.         {
  192.             PlayerInfo[killerid][gSkillSawnoff]++;
  193.             SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, PlayerInfo[playerid][gSkillSawnoff]);
  194.         }
  195.         if(reason == 28)
  196.         {
  197.             PlayerInfo[killerid][gSkillUzi]++;
  198.             SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, PlayerInfo[playerid][gSkillUzi]);
  199.         }
  200.     }
  201.     return 1;
  202. }
  203.  
  204. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  205. {
  206.     if(pTreinando[playerid] == true)
  207.     {
  208.         SendClientMessage(playerid, Vermelho, "Achei que você estivesse treinando ? ¬¬'");
  209.         SetPlayerPos(playerid, 2613.8999000, -2382.3000500, 13.3000000);
  210.         PlayerPlaySound(playerid, 1150, 2613.8999000, -2382.3000500, 13.3000000);
  211.         pAtirou[playerid] = false;
  212.         pTreinando[playerid] = false;
  213.         pAvisado[playerid] = 0;
  214.     }
  215.     return 1;
  216. }
  217.  
  218. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  219. {
  220.     if(pTreinando[playerid] == true)
  221.     {
  222.         SendClientMessage(playerid, Vermelho, "Achei que você estivesse treinando ? ¬¬'");
  223.         SetPlayerPos(playerid, 2613.8999000, -2382.3000500, 13.3000000);
  224.         PlayerPlaySound(playerid, 1150, 2613.8999000, -2382.3000500, 13.3000000);
  225.         SetPlayerInterior(playerid, 0);
  226.         pAtirou[playerid] = false;
  227.         pTreinando[playerid] = false;
  228.         pAvisado[playerid] = 0;
  229.     }
  230.     return 1;
  231. }
  232.  
  233. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  234. {
  235.     if((newkeys & KEY_FIRE && oldkeys != KEY_FIRE ) &&  IsPlayerInRangeOfPoint(playerid, 200.0 , X_OBJETO , Y_OBJETO , 0.0))
  236.     {
  237.         if(pTreinando[playerid] == true)
  238.         {
  239.             if(pAtirou[playerid] == true)
  240.             {
  241.                 pAvisado[playerid]++;
  242.                 SendClientMessage(playerid, Vermelho, "Você também não pode só ficar parado apertando ' Fire ' né ? ¬¬'");
  243.             }
  244.             if(pAvisado[playerid] == 5)
  245.             {
  246.                 SetPlayerPos(playerid, 2613.8999000, -2382.3000500, 13.3000000);
  247.                 PlayerPlaySound(playerid, 1150, 2613.8999000, -2382.3000500, 13.3000000);
  248.                 SendClientMessage(playerid, AzulCiano, "Seu treino foi cancelado por desobedecer o Server '-'.");
  249.                 SetPlayerVirtualWorld(playerid, 0);
  250.                 pAtirou[playerid] = false;
  251.                 pTreinando[playerid] = false;
  252.                 pAvisado[playerid] = 0;
  253.             }
  254.             if(pAtirou[playerid] == false)
  255.                 {
  256.                 static
  257.                     Float:xPos,
  258.                     Float:yPos,
  259.                     Float:zPos,
  260.                     Float:distancia,
  261.                     Float:aPos;
  262.  
  263.                 GetPlayerPos(playerid, xPos, yPos, zPos);
  264.                 GetPlayerFacingAngle(playerid, aPos);
  265.  
  266.                 distancia = floatsqroot(floatpower(floatabs(xPos-X_OBJETO), 2) + floatpower(floatabs(yPos-Y_OBJETO), 2));
  267.                 if(distancia < 30.0) return SendClientMessage(playerid, Vermelho, "Atirando tão de perto suas habilidades não vão melhorar ¬¬'");
  268.                 if(distancia <  100.0)
  269.                 {
  270.                     xPos += (distancia * floatsin(-aPos, degrees)),
  271.                     yPos += (distancia * floatcos(-aPos, degrees));
  272.                     distancia = floatsqroot(floatpower(floatabs(xPos-X_OBJETO), 2) + floatpower(floatabs(yPos-Y_OBJETO), 2));
  273.                 }
  274.  
  275.                 if(TAMANHO_OBJETO > distancia)
  276.                 {
  277.                     new Arma = GetPlayerWeapon(playerid);
  278.                     if(Arma == 22) PlayerInfo[playerid][gHabilidade9mm]++;
  279.                     if(Arma == 23) PlayerInfo[playerid][gHabilidadeSilenced]++;
  280.                     if(Arma == 24) PlayerInfo[playerid][gHabilidadeEagle]++;
  281.                     if(Arma == 25) PlayerInfo[playerid][gHabilidadeShotgun]++;
  282.                     if(Arma == 26) PlayerInfo[playerid][gHabilidadeSawnoff]++;
  283.                     if(Arma == 27) PlayerInfo[playerid][gHabilidadeCombatShotgun]++;
  284.                     if(Arma == 28) PlayerInfo[playerid][gHabilidadeUzi]++;
  285.                     if(Arma == 29) PlayerInfo[playerid][gHabilidadeMP5]++;
  286.                     if(Arma == 30) PlayerInfo[playerid][gHabilidadeAK47]++;
  287.                     if(Arma == 31) PlayerInfo[playerid][gHabilidadeM4]++;
  288.                     if(Arma == 32) PlayerInfo[playerid][gHabilidadeTec9]++;
  289.                     SendClientMessage(playerid, VerdeClaro, "Você acertou o objeto.");
  290.                     SetTimerEx("Liberar", 3000, false, "i", playerid);
  291.                     pAtirou[playerid] = true;
  292.                 }
  293.             }
  294.         }
  295.     }
  296.     return 1;
  297. }
  298.  
  299. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  300. {
  301.     if(issuerid != INVALID_PLAYER_ID)
  302.     {
  303.         if(weaponid == 22)
  304.         {
  305.             if(PlayerInfo[issuerid][gHabilidade9mm] <= 200)
  306.             {
  307.                 amount = 1;
  308.             }
  309.             if(PlayerInfo[issuerid][gHabilidade9mm] >= 201 && PlayerInfo[issuerid][gHabilidade9mm] <= 400)
  310.             {
  311.                 amount = 2;
  312.             }
  313.             if(PlayerInfo[issuerid][gHabilidade9mm] >= 401 && PlayerInfo[issuerid][gHabilidade9mm] <= 600)
  314.             {
  315.                 amount = 3;
  316.             }
  317.             if(PlayerInfo[issuerid][gHabilidade9mm] > 600)
  318.             {
  319.                 amount = 5;
  320.             }
  321.         }
  322.         if(weaponid == 23)
  323.         {
  324.             if(PlayerInfo[issuerid][gHabilidadeSilenced] <= 200)
  325.             {
  326.                 amount = 2;
  327.             }
  328.             if(PlayerInfo[issuerid][gHabilidadeSilenced] >= 201 && PlayerInfo[issuerid][gHabilidadeSilenced] <= 400)
  329.             {
  330.                 amount = 3;
  331.             }
  332.             if(PlayerInfo[issuerid][gHabilidadeSilenced] >= 401 && PlayerInfo[issuerid][gHabilidadeSilenced] <= 600)
  333.             {
  334.                 amount = 4;
  335.             }
  336.             if(PlayerInfo[issuerid][gHabilidadeSilenced] > 600)
  337.             {
  338.                 amount = 5;
  339.             }
  340.         }
  341.         if(weaponid == 24)
  342.         {
  343.             if(PlayerInfo[issuerid][gHabilidadeEagle] <= 200)
  344.             {
  345.                 amount = 32;
  346.             }
  347.             if(PlayerInfo[issuerid][gHabilidadeEagle] >= 201 && PlayerInfo[issuerid][gHabilidadeEagle] <= 400)
  348.             {
  349.                 amount = 37;
  350.             }
  351.             if(PlayerInfo[issuerid][gHabilidadeEagle] >= 401 && PlayerInfo[issuerid][gHabilidadeEagle] <= 600)
  352.             {
  353.                 amount = 42;
  354.             }
  355.             if(PlayerInfo[issuerid][gHabilidadeEagle] > 600)
  356.             {
  357.                 amount = 47;
  358.             }
  359.         }
  360.         if(weaponid == 25)
  361.         {
  362.             if(PlayerInfo[issuerid][gHabilidadeShotgun] <= 200)
  363.             {
  364.                 amount = 27;
  365.             }
  366.             if(PlayerInfo[issuerid][gHabilidadeShotgun] >= 201 && PlayerInfo[issuerid][gHabilidadeShotgun] <= 400)
  367.             {
  368.                 amount = 32;
  369.             }
  370.             if(PlayerInfo[issuerid][gHabilidadeShotgun] >= 401 && PlayerInfo[issuerid][gHabilidadeShotgun] <= 600)
  371.             {
  372.                 amount = 37;
  373.             }
  374.             if(PlayerInfo[issuerid][gHabilidadeShotgun] > 600)
  375.             {
  376.                 amount = 42;
  377.             }
  378.         }
  379.         if(weaponid == 26)
  380.         {
  381.             if(PlayerInfo[issuerid][gHabilidadeSawnoff] <= 200)
  382.             {
  383.                 amount = 27;
  384.             }
  385.             if(PlayerInfo[issuerid][gHabilidadeSawnoff] >= 201 && PlayerInfo[issuerid][gHabilidadeSawnoff] <= 400)
  386.             {
  387.                 amount = 32;
  388.             }
  389.             if(PlayerInfo[issuerid][gHabilidadeSawnoff] >= 401 && PlayerInfo[issuerid][gHabilidadeSawnoff] <= 600)
  390.             {
  391.                 amount = 37;
  392.             }
  393.             if(PlayerInfo[issuerid][gHabilidadeSawnoff] > 600)
  394.             {
  395.                 amount = 42;
  396.             }
  397.         }
  398.         if(weaponid == 27)
  399.         {
  400.             if(PlayerInfo[issuerid][gHabilidadeCombatShotgun] <= 200)
  401.             {
  402.                 amount = 22;
  403.             }
  404.             if(PlayerInfo[issuerid][gHabilidadeCombatShotgun] >= 201 && PlayerInfo[issuerid][gHabilidadeCombatShotgun] <= 400)
  405.             {
  406.                 amount = 27;
  407.             }
  408.             if(PlayerInfo[issuerid][gHabilidadeCombatShotgun] >= 401 && PlayerInfo[issuerid][gHabilidadeCombatShotgun] <= 600)
  409.             {
  410.                 amount = 32;
  411.             }
  412.             if(PlayerInfo[issuerid][gHabilidadeCombatShotgun] > 600)
  413.             {
  414.                 amount = 37;
  415.             }
  416.         }
  417.         if(weaponid == 28)
  418.         {
  419.             if(PlayerInfo[issuerid][gHabilidadeUzi] <= 200)
  420.             {
  421.                 amount = 1;
  422.             }
  423.             if(PlayerInfo[issuerid][gHabilidadeUzi] >= 201 && PlayerInfo[issuerid][gHabilidadeUzi] <= 400)
  424.             {
  425.                 amount = 1;
  426.             }
  427.             if(PlayerInfo[issuerid][gHabilidadeUzi] >= 401 && PlayerInfo[issuerid][gHabilidadeUzi] <= 600)
  428.             {
  429.                 amount = 2;
  430.             }
  431.             if(PlayerInfo[issuerid][gHabilidadeUzi] > 600)
  432.             {
  433.                 amount = 2;
  434.             }
  435.         }
  436.         if(weaponid == 29)
  437.         {
  438.             if(PlayerInfo[issuerid][gHabilidadeMP5] <= 200)
  439.             {
  440.                 amount = 2;
  441.             }
  442.             if(PlayerInfo[issuerid][gHabilidadeMP5] >= 201 && PlayerInfo[issuerid][gHabilidadeMP5] <= 400)
  443.             {
  444.                 amount = 2;
  445.             }
  446.             if(PlayerInfo[issuerid][gHabilidadeMP5] >= 401 && PlayerInfo[issuerid][gHabilidadeMP5] <= 600)
  447.             {
  448.                 amount = 3;
  449.             }
  450.             if(PlayerInfo[issuerid][gHabilidadeMP5] > 600)
  451.             {
  452.                 amount = 3;
  453.             }
  454.         }
  455.         if(weaponid == 30)
  456.         {
  457.             if(PlayerInfo[issuerid][gHabilidadeAK47] <= 200)
  458.             {
  459.                 amount = 1;
  460.             }
  461.             if(PlayerInfo[issuerid][gHabilidadeAK47] >= 201 && PlayerInfo[issuerid][gHabilidadeAK47] <= 400)
  462.             {
  463.                 amount = 2;
  464.             }
  465.             if(PlayerInfo[issuerid][gHabilidadeAK47] >= 401 && PlayerInfo[issuerid][gHabilidadeAK47] <= 600)
  466.             {
  467.                 amount = 3;
  468.             }
  469.             if(PlayerInfo[issuerid][gHabilidadeAK47] > 600)
  470.             {
  471.                 amount = 4;
  472.             }
  473.         }
  474.         if(weaponid == 31)
  475.         {
  476.             if(PlayerInfo[issuerid][gHabilidadeM4] <= 200)
  477.             {
  478.                 amount = 2;
  479.             }
  480.             if(PlayerInfo[issuerid][gHabilidadeM4] >= 201 && PlayerInfo[issuerid][gHabilidadeM4] <= 400)
  481.             {
  482.                 amount = 3;
  483.             }
  484.             if(PlayerInfo[issuerid][gHabilidadeM4] >= 401 && PlayerInfo[issuerid][gHabilidadeM4] <= 600)
  485.             {
  486.                 amount = 4;
  487.             }
  488.             if(PlayerInfo[issuerid][gHabilidadeM4] > 600)
  489.             {
  490.                 amount = 5;
  491.             }
  492.         }
  493.         if(weaponid == 32)
  494.         {
  495.             if(PlayerInfo[issuerid][gHabilidadeTec9] <= 200)
  496.             {
  497.                 amount = 1;
  498.             }
  499.             if(PlayerInfo[issuerid][gHabilidadeTec9] >= 201 && PlayerInfo[issuerid][gHabilidadeTec9] <= 400)
  500.             {
  501.                 amount = 2;
  502.             }
  503.             if(PlayerInfo[issuerid][gHabilidadeTec9] >= 401 && PlayerInfo[issuerid][gHabilidadeTec9] <= 600)
  504.             {
  505.                 amount = 2;
  506.             }
  507.             if(PlayerInfo[issuerid][gHabilidadeTec9] > 600)
  508.             {
  509.                 amount = 3;
  510.             }
  511.         }
  512.     }
  513.     return 1;
  514. }
  515.  
  516. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  517. {
  518.     if(dialogid == DIALOG_CERTEZA)
  519.     {
  520.         if(response)
  521.         {
  522.             ShowPlayerDialog(playerid, DIALOG_ESCOLHERARMA, DIALOG_STYLE_LIST, "Escolha com que arma você deseja treinar", "Pistola 9mm\nPistola 9mm Silenciada\nPistola Desert Eagle\nShotgun\nSawnoff Shotgun\nCombat Shotgun\nUZI\nMP5\nAK-47\nFuzil M4\nTec-9", "Confirmar", "");
  523.             SetPlayerPos(playerid, 2775.8000500,-2336.8000500,13.3000000);
  524.             SetPlayerFacingAngle(playerid, 88.0);
  525.             ResetPlayerWeapons(playerid);
  526.         }
  527.         else
  528.         {
  529.             SendClientMessage(playerid, Vermelho, "OK, aguardamos a sua volta, até logo.");
  530.         }
  531.     }
  532.     if(dialogid == DIALOG_ESCOLHERARMA)
  533.     {
  534.         if(listitem == 0)
  535.         {
  536.             GivePlayerWeapon(playerid, 22, 999);
  537.         }
  538.         if(listitem == 1)
  539.         {
  540.             GivePlayerWeapon(playerid, 23, 999);
  541.         }
  542.         if(listitem == 2)
  543.         {
  544.             GivePlayerWeapon(playerid, 24, 999);
  545.         }
  546.         if(listitem == 3)
  547.         {
  548.             GivePlayerWeapon(playerid, 25, 999);
  549.         }
  550.         if(listitem == 4)
  551.         {
  552.             GivePlayerWeapon(playerid, 26, 999);
  553.         }
  554.         if(listitem == 5)
  555.         {
  556.             GivePlayerWeapon(playerid, 27, 999);
  557.         }
  558.         if(listitem == 6)
  559.         {
  560.             GivePlayerWeapon(playerid, 28, 999);
  561.         }
  562.         if(listitem == 7)
  563.         {
  564.             GivePlayerWeapon(playerid, 29, 999);
  565.         }
  566.         if(listitem == 8)
  567.         {
  568.             GivePlayerWeapon(playerid, 30, 999);
  569.         }
  570.         if(listitem == 9)
  571.         {
  572.             GivePlayerWeapon(playerid, 31, 999);
  573.         }
  574.         if(listitem == 10)
  575.         {
  576.             GivePlayerWeapon(playerid, 32, 999);
  577.         }
  578.         SendClientMessage(playerid, Vermelho, "Para sair do treino use /sairtreino");
  579.         SendClientMessage(playerid, Amarelo, "Acerte o alvo da maior distância possível, boa-sorte !");
  580.         TogglePlayerControllable(playerid, true);
  581.         pTreinando[playerid] = true;
  582.         SetPlayerVirtualWorld(playerid, playerid);
  583.     }
  584.     return 1;
  585. }
  586.  
  587. public OnPlayerEnterCheckpoint(playerid)
  588. {
  589.     if(QuerendoTreinar[playerid] == true)
  590.     {
  591.         ShowPlayerDialog(playerid, DIALOG_CERTEZA, DIALOG_STYLE_MSGBOX, "Você tem certeza ?", "Se decidir prosseguir perderá todas as armas.\nTem certeza que deseja continuar ?", "SIM", "NAO");
  592.         DisablePlayerCheckpoint(playerid);
  593.         QuerendoTreinar[playerid] = false;
  594.     }
  595.     return 1;
  596. }
  597.  
  598. /* COMANDOS */
  599.  
  600. CMD:tutorialhabilidades(playerid)
  601. {
  602.     SendClientMessage(playerid, Amarelo, "Este servidor conta com o sistema de habilidades com armas feito por Graf_Spee");
  603.     SendClientMessage(playerid, Amarelo, "O sistema funciona da seguinte forma: cada jogador possui uma habilidade específica [...]");
  604.     SendClientMessage(playerid, Amarelo, "[...] para cada arma, quanto maior for esta habilidade, maior dano a arma dará.");
  605.     SendClientMessage(playerid, Amarelo, "Para treinar a sua habilidade, use: /treinoarmas e dirija-se ao ponto vermelho no mapa.");
  606.     return 1;
  607. }
  608.    
  609. CMD:treinoarmas(playerid)
  610. {
  611.     QuerendoTreinar[playerid] = true;
  612.     SetPlayerPos(playerid, 2613.8999000, -2382.3000500, 13.3000000);
  613.     SetPlayerCheckpoint(playerid, 2613.8999000, -2382.3000500, 13.3000000, 3.0);
  614.     pAtirou[playerid] = false;
  615.     pTreinando[playerid] = false;
  616.     pAvisado[playerid] = 0;
  617.     return 1;
  618. }
  619.  
  620. CMD:sairtreino(playerid)
  621. {
  622.     SendClientMessage(playerid, AzulCiano, "Você saiu do treino.");
  623.     SetPlayerPos(playerid, 2613.8999000, -2382.3000500, 13.3000000);
  624.     PlayerPlaySound(playerid, 1150, 2613.8999000, -2382.3000500, 13.3000000);
  625.     SetPlayerVirtualWorld(playerid, 0);
  626.     pTreinando[playerid] = false;
  627.     pAtirou[playerid] = false;
  628.     pAvisado[playerid] = 0;
  629.     return 1;
  630. }
  631.  
  632. stock GetPlayerNameEx(playerid)
  633. {
  634.     new N[25];
  635.     GetPlayerName(playerid,N,sizeof(N));
  636.     return N;
  637. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement