Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.51 KB | None | 0 0
  1. /*---------------//
  2. Sistema por Rafael Dantas(wgrafal), Habbo.it@hotmail.com
  3. Caso pagou por esse sistema, entre em contato com o e-mail: habbo.it@hotmail.com..*/
  4.  
  5. // Adicione a forward
  6.  
  7. forward LoadBanco();
  8. forward SaveBanco();
  9.  
  10. // Adicione a enum.
  11.  
  12. enum sInfo
  13. {
  14.     Salario,
  15. };
  16. new SalarioInfo[10][sInfo];
  17.  
  18. // Crie a Public Load e Save
  19.  
  20. public LoadBanco()
  21. {
  22.     new arrCoords[11][64];
  23.     new strFromFile2[256];
  24.     new File: file = fopen("banco.cfg", io_read);
  25.     if (file)
  26.     {
  27.         new idx;
  28.         while (idx < sizeof(SalarioInfo))
  29.         {
  30.             fread(file, strFromFile2);
  31.             split(strFromFile2, arrCoords, '|');
  32.             SalarioInfo[idx][Salario] = strval(arrCoords[0]);
  33.             printf("O sálario está: d%",
  34.             idx,SalarioInfo[idx][Salario]);
  35.             idx++;
  36.         }
  37.         fclose(file);
  38.     }
  39.     return 1;
  40. }
  41.  
  42. public SaveBanco()
  43. {
  44.     new idx;
  45.     new File: file2;
  46.     while (idx < sizeof(SalarioInfo))
  47.     {
  48.         new coordsstring[256];
  49.         format(coordsstring, sizeof(coordsstring), "%d\n",
  50.         SalarioInfo[idx][Salario]);
  51.         if(idx == 0)
  52.         {
  53.             file2 = fopen("banco.cfg", io_write);
  54.         }
  55.         else
  56.         {
  57.             file2 = fopen("banco.cfg", io_append);
  58.         }
  59.         fwrite(file2, coordsstring);
  60.         idx++;
  61.         fclose(file2);
  62.     }
  63.     return 1;
  64. }
  65.  
  66.  
  67.  
  68. // em seu Public PayDay, Procure por new checks = PlayerInfo[i][pPayCheck] troque por
  69.  
  70. new checks = SalarioInfo[Salario][Salario];
  71.  
  72. // Crie o comando /salario para definir o salário.
  73.  
  74.     if(strcmp(cmd,"/salario",true)==0)
  75.     {
  76.         if(IsPlayerConnected(playerid))
  77.         {
  78.             if(PlayerInfo[playerid][pLeader] != 7)
  79.             {
  80.                 SendClientMessage(playerid, COLOR_GREY, "   Você não é o prefeito !");
  81.                 return 1;
  82.             }
  83.             tmp = strtok(cmdtext, idx);
  84.             if(!strlen(tmp)) {
  85.                 SendClientMessage(playerid, COLOR_WHITE, "USAGE: /salario [ammount]");
  86.                 return 1;
  87.             }
  88.             moneys = strval(tmp);
  89.             if(moneys < 150 || moneys > 990) { SendClientMessage(playerid, COLOR_GREY, "  Sálario Loco! Use de 150 Dolares até 990 Dolares."); return 1; } // < 150:Valor Minimo || moneys > 990:Valor Maximo)
  90.             SalarioInfo[Salario][Salario] = moneys;
  91.             SaveBanco();
  92.             format(string, sizeof(string), "* O sálario, diante de agora é $%d por Jogador.", SalarioInfo[Salario][Salario]);
  93.             SendClientMessage(playerid, COLOR_WHITE, string);
  94.         }
  95.         return 1;
  96.     }
  97.  
  98.  
  99. // Crie um arquivo em scriptfiles, Como o nome: banco.cfg, dentro desser arquivo ficaria assim:
  100. 500
  101.  
  102. /* Nesse 500 Você coloca o salário inicial, lembrando, que quando digitado /salario, o mesmo muda.
  103.  
  104.  
  105. // Duvidas? Habbo.it@hotmail.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement