Guest User

Untitled

a guest
Feb 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. if((strncmp(comando, "Criar %s", 5) == 0))
  2. {
  3. if(cGuild != 0)
  4. {
  5. SendClientMsg(clientid, "Você ja pertence a alguma guild !");
  6. return;
  7. }
  8. if(cGold <= 99999999)
  9. {
  10. SendClientMsg(clientid, "Necessario 100 Milhões de gold !");
  11. return;
  12. }
  13. if(cGuild == 509)
  14. {
  15. SendClientMsg(clientid, "Você ja tem Guild !");
  16. return;
  17. }
  18. if(file_exists("Dados.txt"))
  19. {
  20. arquivo = fopen("Dados.txt", "r");
  21. while ((fscanf(arquivo, "%[^\n]", line)) != EOF)
  22. {
  23. fgetc(arquivo);
  24. int Guil1,Guil2,Guil3;
  25. sscanf(line, "%d,%d,%d",&Guil1,&Guil2,&Guil3);
  26. {
  27. PByte(0x04BFF76) = Guil1;
  28. PByte(0x04BFF77) = Guil2;
  29. PByte(0x04BFF78) = Guil3;
  30. fclose(arquivo);
  31. }
  32. }
  33. arquivo = fopen("Dados.txt", "w");
  34. if(arquivo != NULL)
  35. {
  36. cGold -= 100000000;
  37. PByte(0x04BFF76) += 1;
  38. PByte(0x04BFF77) += 1;
  39. PByte(0x04BFF78) += 1;
  40. Guild1 = PByte(0x04BFF76);
  41. Guild2 = PByte(0x04BFF77);
  42. Guild3 = PByte(0x04BFF78);
  43. PInt(addr_bclient + 0x015C6A74) = 509;
  44. PInt(addr_bclient + 0x015C6A74 +2) = 56;
  45. PInt(addr_bclient + 0x015C6A74 +3) = Guild1;
  46. PInt(addr_bclient + 0x015C6A74 +4) = 57;
  47. PInt(addr_bclient + 0x015C6A74 +5) = Guild2;
  48. PInt(addr_bclient + 0x015C6A74 +6) = 59;
  49. PInt(addr_bclient + 0x015C6A74 +7) = Guild3;
  50. PLong(addr_bclient + 0x015C69D0) = cGold;
  51. SendALL(clientid);
  52. SendItens(clientid,12);
  53. SendClientMsg(clientid, "Guild Registrada !");
  54. SaveChar(1,clientid);
  55. SendCharList(clientid);
  56. Guil1 = PByte(0x04BFF76);
  57. Guil2 = PByte(0x04BFF77);
  58. Guil3 = PByte(0x04BFF78);
  59. sprintf(tmp,"%d,%d,%d",Guil1,Guil1,Guil1);
  60. fputs(tmp, arquivo);
  61. fclose(arquivo);
  62. return;
  63. }
  64. }
  65. else
  66. {
  67. arquivo = fopen("Dados.txt", "w");
  68. if(arquivo != NULL)
  69. {
  70. char text[] = "1,1,1";
  71. fputs(text, arquivo);
  72. fclose(arquivo);
  73. }
  74. }
  75. }
Add Comment
Please, Sign In to add comment