Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. #include "Functions.h"
  2. #include "Define.h"
  3.  
  4. void teste(int clientid)
  5. {
  6. int addr_bclient = clientid * 0x0410;
  7. unsigned long int exp_list[400];
  8. FILE *stream;
  9. int cont, maxclear;
  10. char line[80];
  11. double dif;
  12.  
  13.  
  14. struct Clear {
  15. int x1;
  16. int y1;
  17. int x2;
  18. int y2;
  19. } clear[300];
  20.  
  21.  
  22. DWORD WINAPI OnTime()
  23. {
  24. time_t start,end;
  25. time (&start);
  26. while(1)
  27. {
  28. time(&end);
  29. if(((difftime (end,start))/10) >= 1/*10 minutos*/)
  30. {
  31. cont = 0;
  32. maxclear = 0;
  33. while(cont <= maxclear)
  34. {
  35. ClearArea (2378, 2077, 2426, 2133);
  36. Teleport(clientid, 4000, 4000);
  37. cont++;
  38. }
  39. time (&start);
  40. }
  41. Sleep(10000);
  42. }
  43. return 0;
  44. }
  45.  
  46. DWORD WINAPI OnTime2()
  47. {
  48. time_t start,end;
  49. time (&start);
  50. while(1)
  51. {
  52. time(&end);
  53. if(((difftime (end,start))/15) >= 1/*10 minutos*/)
  54. {
  55. cont = 0;
  56. maxclear = 0;
  57. while(cont <= maxclear)
  58. {
  59. ClearArea (458, 3886, 496, 3917);
  60. Teleport(clientid, 4000, 4000);
  61. SendNotice("armia !!!");
  62. cont++;
  63. }
  64. time (&start);
  65. }
  66. Sleep(10000);
  67. }
  68. return 0;
  69. }
  70.  
  71.  
  72. void DllInit()
  73.  
  74. {
  75. stream = fopen("exp.txt", "r");
  76. while ((fscanf(stream, "%[^\n]", line)) != EOF) //exp.txt
  77. {
  78. fgetc(stream);
  79. sscanf(line, "exp_list[%d] = %lu",&cont, &exp_list[cont]);
  80. cont++;
  81. }
  82. fclose(stream);
  83.  
  84. stream = fopen("clear.csv", "r");
  85. maxclear = 0;
  86. while ((fscanf(stream, "%[^\n]", line)) != EOF) //clear.cvs
  87. {
  88. fgetc(stream);
  89. sscanf(line, "%d,%d,%d,%d", &clear[maxclear].x1, &clear[maxclear].y1, &clear[maxclear].x2, &clear[maxclear].y2);
  90. maxclear++;
  91. }
  92. fclose(stream);
  93. CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)OnTime, NULL, 0, 0);
  94. CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)OnTime2, NULL, 0, 0);
  95. return;
  96. }
  97.  
  98.  
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement