Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <sscanf2>//Credits for sscanf goes to Y_Less
- public OnFilterScriptInit()
- {
- print("\n---------------------------------------------");
- print("SA:MP 0.3c objects PAWN converter by leong124");
- print("---------------------------------------------\n");
- if(!fexist("Source_objects.txt")) return print("Error: Source_objects.txt does not found.");
- new File:source = fopen("Source_objects.txt",io_read);
- new File:output = fopen("Output_objects.txt",io_write);
- new string[128],str0[128],str1[128],objid,k = 0,j = 0;
- while(fread(source,string,sizeof(string)))
- {
- if(!sscanf(string,"p<,>s[128]s[128]",str0,str1) && !sscanf(str0,"p<(>s[128]d",str0,objid))
- {
- switch(objid)
- {
- case 14383..14483: objid += 4248;
- case 14770..14856: objid += 4063;
- case 14858..14871: objid += 4062;
- case 18000..18036: objid += 934;
- case 18038..18101: objid += 933;
- case 14872..14883: objid += 4163;
- case 14885..14891: objid += 4162;
- case 13590..13667: objid += 5142;
- case 14500..14522: objid += 4310;
- case 12835..12944: objid += 6219;
- case 16000..16143: objid += 3164;
- case 14892: objid += 5009;
- }
- format(string,sizeof(string),"%s(%d,%s",str0,objid,str1);
- fwrite(output,string);
- k++;
- }
- else printf("Error: Incorrect format at line %d.",j);
- j++;
- }
- fclose(source);
- fclose(output);
- printf("%d objects converted.",k);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement