Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////////////
- // //
- // Homehots.net //
- // Postado por ViitorSouza //
- // Sistema de Arara by FreeGells! //
- // //
- // Ajuda de Shadoww5. //
- // //
- /////////////////////////////////////////////
- #include <a_samp>
- #include <dini>
- #define BRANCO 0xFFFFFFFF
- #define VERMELHO 0xFF0000FF
- enum a
- {
- bool:Arara,
- bool:Racao,
- Grande,
- Timer
- }
- new Info[MAX_PLAYERS][a];
- public OnFilterScriptInit()
- {
- if(!fexist("Araras.txt")) { dini_Create("Araras.txt"); }
- return 1;
- }
- public OnFilterScriptExit()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(Info[i][Arara]) { RemovePlayerAttachedObject(i, 0); }
- }
- return 1;
- }
- forward Crescimento(playerid);
- public OnPlayerConnect(playerid)
- {
- new nome[24], str[50];
- GetPlayerName(playerid, nome, 24);
- format(str, sizeof str, "%s - Arara", nome);
- if(dini_Isset("Araras.txt", str))
- {
- Info[playerid][Arara] = bool:dini_Bool("Araras.txt", str);
- format(str, sizeof str, "%s - Racao", nome);
- Info[playerid][Racao] = bool:dini_Bool("Araras.txt", str);
- format(str, sizeof str, "%s - Grande", nome);
- Info[playerid][Grande] = dini_Int("Araras.txt", str);
- if(Info[playerid][Arara])
- {
- Info[playerid][Timer] = SetTimerEx("Crescimento", 300000, true, "i", playerid);
- SendClientMessage(playerid, 0xFFFF00FF, "Alimente sua arara ou ela morrerá.");
- }
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- 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 ); }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new nome[24], str[50];
- GetPlayerName(playerid, nome, 24);
- format(str, sizeof str, "%s - Arara", nome);
- dini_BoolSet("Araras.txt", str, Info[playerid][Arara]);
- format(str, sizeof str, "%s - Racao", nome);
- dini_BoolSet("Araras.txt", str, Info[playerid][Racao]);
- format(str, sizeof str, "%s - Grande", nome);
- dini_IntSet("Araras.txt", str, Info[playerid][Grande]);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/comprararara", true) == 0)
- {
- if(Info[playerid][Grande] >= 5) return SendClientMessage(playerid, VERMELHO, "Sua Arara Está Grande e Pronta para ser vendida, Para vender digite /VenderArara !");
- if(GetPlayerMoney(playerid)<2000)return SendClientMessage(playerid, BRANCO,"Você não tem R$2000!");
- if(Info[playerid][Arara]) return SendClientMessage(playerid, BRANCO, "Você já tem uma Arara!");
- SendClientMessage(playerid, BRANCO, "Você Comprou uma Arara!");
- SendClientMessage(playerid, BRANCO, "Ela irá crescer de Cinco a Cinco Minutos!");
- SendClientMessage(playerid, BRANCO, "Não se esqueça de Alimenta-lá! /Racão!");
- SetPlayerAttachedObject(playerid,0, 19079, 1, 0.319503, -0.089340, -0.185576, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
- GivePlayerMoney(playerid, -2000);
- Info[playerid][Arara] = true;
- Info[playerid][Timer] = SetTimerEx("Crescimento", 300000, true, "i", playerid);
- return 1;
- }
- if(strcmp(cmdtext, "/alimentada", true) == 0)
- {
- if(Info[playerid][Grande] >= 5) return SendClientMessage(playerid, VERMELHO, "Sua Arara Está Grande e Pronta para ser vendida, Para vender digite /VenderArara !");
- if(!Info[playerid][Arara]) return SendClientMessage(playerid, VERMELHO, "Você não tem uma arara.");
- if(Info[playerid][Racao]) { SendClientMessage(playerid, BRANCO, "Arara Alimentada: {008000}Sim"); }
- else { SendClientMessage(playerid, BRANCO, "Arara Alimentada: {FF0000}Não"); }
- return 1;
- }
- if(strcmp(cmdtext, "/racao", true) == 0)
- {
- if(Info[playerid][Grande] >= 5) return SendClientMessage(playerid, VERMELHO, "Sua Arara Está Grande e Pronta para ser vendida, Para vender digite /VenderArara !");
- if(!Info[playerid][Arara]) return SendClientMessage(playerid, VERMELHO, "Você não tem uma arara.");
- if(Info[playerid][Racao]) return SendClientMessage(playerid, BRANCO, "Você já Alimentou sua Arara!");
- SendClientMessage(playerid, BRANCO, "Você Alimentou Sua Arara! Isso lhe custou R$200");
- GivePlayerMoney(playerid, -200);
- Info[playerid][Racao] = true;
- return 1;
- }
- if(strcmp(cmdtext, "/venderarara", true) == 0)
- {
- if(!Info[playerid][Arara]) return SendClientMessage(playerid, BRANCO,"Você Não comprou nenhuma Arara!");
- if(Info[playerid][Grande] < 5) return SendClientMessage(playerid, BRANCO,"Sua Arara ainda não está grande!");
- Info[playerid][Grande] = 0;
- Info[playerid][Arara] = false;
- RemovePlayerAttachedObject(playerid, 0);
- GivePlayerMoney(playerid, 10000);
- SendClientMessage(playerid, BRANCO, "Você Vendeu Sua Arara e ganhou R$10000!");
- return 1;
- }
- return 0;
- }
- public Crescimento(playerid)
- {
- if(!Info[playerid][Arara])
- {
- KillTimer(Info[playerid][Timer]);
- return 0;
- }
- if(!Info[playerid][Racao] && Info[playerid][Grande] < 5)
- {
- SendClientMessage(playerid, BRANCO, "Você não alimentou sua Arara e Ela Morreu!");
- RemovePlayerAttachedObject(playerid, 0);
- Info[playerid][Arara] = false;
- Info[playerid][Grande] = 0;
- KillTimer(Info[playerid][Timer]);
- return 1;
- }
- new str[30];
- Info[playerid][Grande]++;
- Info[playerid][Racao] = false;
- format(str, sizeof str, "Sua Arara Cresceu! (%d/5)", Info[playerid][Grande]);
- SendClientMessage(playerid, BRANCO, str);
- if(Info[playerid][Grande] >= 5)
- {
- SendClientMessage(playerid, BRANCO, "Sua Arara Está Grande e Pronta para ser vendida, Para vender digite /VenderArara !");
- KillTimer(Info[playerid][Timer]);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement