Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Functions.h"
- #include "Define.h"
- void teste(int clientid)
- {
- int addr_bclient = clientid * 0x0410;
- unsigned long int exp_list[400];
- FILE *stream;
- int cont, maxclear;
- char line[80];
- double dif;
- struct Clear {
- int x1;
- int y1;
- int x2;
- int y2;
- } clear[300];
- DWORD WINAPI OnTime()
- {
- time_t start,end;
- time (&start);
- while(1)
- {
- time(&end);
- if(((difftime (end,start))/10) >= 1/*10 minutos*/)
- {
- cont = 0;
- maxclear = 0;
- while(cont <= maxclear)
- {
- ClearArea (2378, 2077, 2426, 2133);
- Teleport(clientid, 4000, 4000);
- cont++;
- }
- time (&start);
- }
- Sleep(10000);
- }
- return 0;
- }
- DWORD WINAPI OnTime2()
- {
- time_t start,end;
- time (&start);
- while(1)
- {
- time(&end);
- if(((difftime (end,start))/15) >= 1/*10 minutos*/)
- {
- cont = 0;
- maxclear = 0;
- while(cont <= maxclear)
- {
- ClearArea (458, 3886, 496, 3917);
- Teleport(clientid, 4000, 4000);
- SendNotice("armia !!!");
- cont++;
- }
- time (&start);
- }
- Sleep(10000);
- }
- return 0;
- }
- void DllInit()
- {
- stream = fopen("exp.txt", "r");
- while ((fscanf(stream, "%[^\n]", line)) != EOF) //exp.txt
- {
- fgetc(stream);
- sscanf(line, "exp_list[%d] = %lu",&cont, &exp_list[cont]);
- cont++;
- }
- fclose(stream);
- stream = fopen("clear.csv", "r");
- maxclear = 0;
- while ((fscanf(stream, "%[^\n]", line)) != EOF) //clear.cvs
- {
- fgetc(stream);
- sscanf(line, "%d,%d,%d,%d", &clear[maxclear].x1, &clear[maxclear].y1, &clear[maxclear].x2, &clear[maxclear].y2);
- maxclear++;
- }
- fclose(stream);
- CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)OnTime, NULL, 0, 0);
- CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)OnTime2, NULL, 0, 0);
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement