Advertisement
Guest User

Untitled

a guest
Jul 16th, 2011
1,739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.70 KB | None | 0 0
  1. /////////////////////////////////////////////
  2. //                                         //
  3. //        Homehots.net                     //
  4. //          Postado por ViitorSouza        //
  5. //      Sistema de Arara by FreeGells!     //
  6. //                                         //
  7. //            Ajuda de Shadoww5.           //
  8. //                                         //
  9. /////////////////////////////////////////////
  10.  
  11. #include <a_samp>
  12. #include <dini>
  13.  
  14. #define BRANCO 0xFFFFFFFF
  15. #define VERMELHO 0xFF0000FF
  16.  
  17. enum a
  18. {
  19.     bool:Arara,
  20.     bool:Racao,
  21.     Grande,
  22.     Timer
  23. }
  24. new Info[MAX_PLAYERS][a];
  25.  
  26. public OnFilterScriptInit()
  27. {
  28.     if(!fexist("Araras.txt")) { dini_Create("Araras.txt"); }
  29.     return 1;
  30. }
  31.  
  32. public OnFilterScriptExit()
  33. {
  34.     for(new i = 0; i < MAX_PLAYERS; i++)
  35.     {
  36.         if(Info[i][Arara]) { RemovePlayerAttachedObject(i, 0); }
  37.     }
  38.     return 1;
  39. }
  40.  
  41. forward Crescimento(playerid);
  42.  
  43. public OnPlayerConnect(playerid)
  44. {
  45.     new nome[24], str[50];
  46.     GetPlayerName(playerid, nome, 24);
  47.     format(str, sizeof str, "%s - Arara", nome);
  48.     if(dini_Isset("Araras.txt", str))
  49.     {
  50.         Info[playerid][Arara] = bool:dini_Bool("Araras.txt", str);
  51.         format(str, sizeof str, "%s - Racao", nome);
  52.         Info[playerid][Racao] = bool:dini_Bool("Araras.txt", str);
  53.         format(str, sizeof str, "%s - Grande", nome);
  54.         Info[playerid][Grande] = dini_Int("Araras.txt", str);
  55.         if(Info[playerid][Arara])
  56.         {
  57.             Info[playerid][Timer] = SetTimerEx("Crescimento", 300000, true, "i", playerid);
  58.             SendClientMessage(playerid, 0xFFFF00FF, "Alimente sua arara ou ela morrerá.");
  59.         }
  60.     }
  61.     return 1;
  62. }
  63.  
  64. public OnPlayerSpawn(playerid)
  65. {
  66.     if(Info[playerid][Arara]) { SetPlayerAttachedObject(playerid,0, 19079, 1, 0.319503, -0.089340, -0.185576, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); }
  67.     return 1;
  68. }
  69. public OnPlayerDisconnect(playerid, reason)
  70. {
  71.     new nome[24], str[50];
  72.     GetPlayerName(playerid, nome, 24);
  73.     format(str, sizeof str, "%s - Arara", nome);
  74.     dini_BoolSet("Araras.txt", str, Info[playerid][Arara]);
  75.     format(str, sizeof str, "%s - Racao", nome);
  76.     dini_BoolSet("Araras.txt", str, Info[playerid][Racao]);
  77.     format(str, sizeof str, "%s - Grande", nome);
  78.     dini_IntSet("Araras.txt", str, Info[playerid][Grande]);
  79.     return 1;
  80. }
  81.  
  82. public OnPlayerCommandText(playerid, cmdtext[])
  83. {
  84.     if(strcmp(cmdtext, "/comprararara", true) == 0)
  85.     {
  86.         if(Info[playerid][Grande] >= 5) return SendClientMessage(playerid, VERMELHO, "Sua Arara Está Grande e Pronta para ser vendida, Para vender digite /VenderArara !");
  87.         if(GetPlayerMoney(playerid)<2000)return SendClientMessage(playerid, BRANCO,"Você não tem R$2000!");
  88.         if(Info[playerid][Arara]) return SendClientMessage(playerid, BRANCO, "Você já tem uma Arara!");
  89.         SendClientMessage(playerid, BRANCO, "Você Comprou uma Arara!");
  90.         SendClientMessage(playerid, BRANCO, "Ela irá crescer de Cinco a Cinco Minutos!");
  91.         SendClientMessage(playerid, BRANCO, "Não se esqueça de Alimenta-lá! /Racão!");
  92.         SetPlayerAttachedObject(playerid,0, 19079, 1, 0.319503, -0.089340, -0.185576, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
  93.         GivePlayerMoney(playerid, -2000);
  94.         Info[playerid][Arara] = true;
  95.         Info[playerid][Timer] = SetTimerEx("Crescimento", 300000, true, "i", playerid);
  96.         return 1;
  97.     }
  98.     if(strcmp(cmdtext, "/alimentada", true) == 0)
  99.     {
  100.         if(Info[playerid][Grande] >= 5) return SendClientMessage(playerid, VERMELHO, "Sua Arara Está Grande e Pronta para ser vendida, Para vender digite /VenderArara !");
  101.         if(!Info[playerid][Arara]) return SendClientMessage(playerid, VERMELHO, "Você não tem uma arara.");
  102.         if(Info[playerid][Racao]) { SendClientMessage(playerid, BRANCO, "Arara Alimentada: {008000}Sim"); }
  103.         else { SendClientMessage(playerid, BRANCO, "Arara Alimentada: {FF0000}Não"); }
  104.         return 1;
  105.     }
  106.     if(strcmp(cmdtext, "/racao", true) == 0)
  107.     {
  108.         if(Info[playerid][Grande] >= 5) return SendClientMessage(playerid, VERMELHO, "Sua Arara Está Grande e Pronta para ser vendida, Para vender digite /VenderArara !");
  109.         if(!Info[playerid][Arara]) return SendClientMessage(playerid, VERMELHO, "Você não tem uma arara.");
  110.         if(Info[playerid][Racao]) return SendClientMessage(playerid, BRANCO, "Você já Alimentou sua Arara!");
  111.         SendClientMessage(playerid, BRANCO, "Você Alimentou Sua Arara! Isso lhe custou R$200");
  112.         GivePlayerMoney(playerid, -200);
  113.         Info[playerid][Racao] = true;
  114.         return 1;
  115.     }
  116.     if(strcmp(cmdtext, "/venderarara", true) == 0)
  117.     {
  118.         if(!Info[playerid][Arara]) return SendClientMessage(playerid, BRANCO,"Você Não comprou nenhuma Arara!");
  119.         if(Info[playerid][Grande] < 5) return SendClientMessage(playerid, BRANCO,"Sua Arara ainda não está grande!");
  120.         Info[playerid][Grande] = 0;
  121.         Info[playerid][Arara] = false;
  122.         RemovePlayerAttachedObject(playerid, 0);
  123.         GivePlayerMoney(playerid, 10000);
  124.         SendClientMessage(playerid, BRANCO, "Você Vendeu Sua Arara e ganhou R$10000!");
  125.         return 1;
  126.     }
  127.     return 0;
  128. }
  129.  
  130.  
  131. public Crescimento(playerid)
  132. {
  133.     if(!Info[playerid][Arara])
  134.     {
  135.         KillTimer(Info[playerid][Timer]);
  136.         return 0;
  137.     }
  138.     if(!Info[playerid][Racao] && Info[playerid][Grande] < 5)
  139.     {
  140.         SendClientMessage(playerid, BRANCO, "Você não alimentou sua Arara e Ela Morreu!");
  141.         RemovePlayerAttachedObject(playerid, 0);
  142.         Info[playerid][Arara] = false;
  143.         Info[playerid][Grande] = 0;
  144.         KillTimer(Info[playerid][Timer]);
  145.         return 1;
  146.     }
  147.     new str[30];
  148.     Info[playerid][Grande]++;
  149.     Info[playerid][Racao] = false;
  150.     format(str, sizeof str, "Sua Arara Cresceu! (%d/5)", Info[playerid][Grande]);
  151.     SendClientMessage(playerid, BRANCO, str);
  152.     if(Info[playerid][Grande] >= 5)
  153.     {
  154.         SendClientMessage(playerid, BRANCO, "Sua Arara Está Grande e Pronta para ser vendida, Para vender digite /VenderArara !");
  155.         KillTimer(Info[playerid][Timer]);
  156.     }
  157.     return 1;
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement