Advertisement
leong124

samp0.3c.pwn

May 29th, 2011
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.44 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <sscanf2>//Credits for sscanf goes to Y_Less
  5.  
  6. public OnFilterScriptInit()
  7. {
  8.     print("\n---------------------------------------------");
  9.     print("SA:MP 0.3c objects PAWN converter by leong124");
  10.     print("---------------------------------------------\n");
  11.     if(!fexist("Source_objects.txt")) return print("Error: Source_objects.txt does not found.");
  12.     new File:source = fopen("Source_objects.txt",io_read);
  13.     new File:output = fopen("Output_objects.txt",io_write);
  14.     new string[128],str0[128],str1[128],objid,k = 0,j = 0;
  15.     while(fread(source,string,sizeof(string)))
  16.     {
  17.         if(!sscanf(string,"p<,>s[128]s[128]",str0,str1) && !sscanf(str0,"p<(>s[128]d",str0,objid))
  18.         {
  19.             switch(objid)
  20.             {
  21.                 case 14383..14483: objid += 4248;
  22.                 case 14770..14856: objid += 4063;
  23.                 case 14858..14871: objid += 4062;
  24.                 case 18000..18036: objid += 934;
  25.                 case 18038..18101: objid += 933;
  26.                 case 14872..14883: objid += 4163;
  27.                 case 14885..14891: objid += 4162;
  28.                 case 13590..13667: objid += 5142;
  29.                 case 14500..14522: objid += 4310;
  30.                 case 12835..12944: objid += 6219;
  31.                 case 16000..16143: objid += 3164;
  32.                 case 14892: objid += 5009;
  33.             }
  34.             format(string,sizeof(string),"%s(%d,%s",str0,objid,str1);
  35.             fwrite(output,string);
  36.             k++;
  37.         }
  38.         else printf("Error: Incorrect format at line %d.",j);
  39.         j++;
  40.     }
  41.     fclose(source);
  42.     fclose(output);
  43.     printf("%d objects converted.",k);
  44.     return 1;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement