Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!fexist("stunts.txt")) {
- print("stunts.txt does not exist! Creating it.");
- new File:fhandle = fopen("stunts.txt", io_write);
- fwrite(fhandle, "");
- fclose(fhandle);
- }
- new File:stuntTxt = fopen("stunts.txt", io_read);
- new string[400];
- for (new i = 0; i < MAX_STUNTS; i++) {
- fread(stuntTxt, string);
- printf("String read is %s", string);
- //2|1967.3712|-1423.8013|13.5749|98.4679|1827.6267|-1432.4915|35.9219|3.0|1500|"LS bike part, jump to east building"
- /*
- enum
- stuntArray
- {
- stuntID,
- Float:spawnX,
- Float:spawnY,
- Float:spawnZ,
- Float:spawnR,
- Float:coronaX,
- Float:coronaY,
- Float:coronaZ,
- Float:coronaSize,
- prizeMoney
- };
- new stuntInfo[MAX_STUNTS][stuntArray];*/
- if (sscanf(string, "p<|>iffffffffis[400]", stuntInfo[i][stuntID], stuntInfo[i][spawnX], stuntInfo[i][spawnY],
- stuntInfo[i][spawnZ], stuntInfo[i][spawnR], stuntInfo[i][coronaX],
- stuntInfo[i][coronaY], stuntInfo[i][coronaZ], stuntInfo[i][coronaSize],
- stuntInfo[i][prizeMoney], stuntInfo[i][description])) {
- print("There was an error loading that stunt...");
- }
- else {
- printf("Loaded stunt %i. Info: %.1f %.1f %.1f %.1f | %.1f %.1f %.1f %.1f | %i", i, stuntInfo[i][spawnX], stuntInfo[i][spawnY],
- stuntInfo[i][spawnZ], stuntInfo[i][spawnR], stuntInfo[i][coronaX],
- stuntInfo[i][coronaY], stuntInfo[i][coronaZ], stuntInfo[i][coronaSize],
- stuntInfo[i][prizeMoney]);
- printf("Desc: %s", stuntInfo[i][description]);
- }
- }
- stuntLoadFailed = false;
- fclose(stuntTxt);
- print("----------Results---------");
- for (new i = 0; i < MAX_STUNTS; i++) {
- printf("Loaded stunt %i. Info: %.1f %.1f %.1f %.1f | %.1f %.1f %.1f %.1f | %i", i, stuntInfo[i][spawnX], stuntInfo[i][spawnY],
- stuntInfo[i][spawnZ], stuntInfo[i][spawnR], stuntInfo[i][coronaX],
- stuntInfo[i][coronaY], stuntInfo[i][coronaZ], stuntInfo[i][coronaSize],
- stuntInfo[i][prizeMoney]);
- printf("Desc: %s", stuntInfo[i][description]);
- }
Advertisement
Add Comment
Please, Sign In to add comment