Advertisement
Guest User

Untitled

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