Guest User

Untitled

a guest
Jan 26th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.97 KB | None | 0 0
  1. #define FLATPATH "Flats/%d.txt"
  2. enum fInfo
  3. {
  4.     FlatID,
  5.     Float:FlatEnterX,
  6.     Float:FlatEnterY,
  7.     Float:FlatEnterZ
  8. };
  9. new FlatInfo[MAX_FLATS][fInfo];
  10.  
  11. [...]
  12. forward LoadFlats(playerid);
  13. public LoadFlats(playerid)
  14. {
  15.         new flatid;
  16.         flatid = 1; //Tempoary flat ID to test the script
  17.         if(fexist(fFile(flatid))) //if the file with name "1" in Scriptfiles/Flats exists:
  18.         {
  19.           SendClientMessage(playerid,-1,"Attempting to load flat file");
  20.           INI_ParseFile(fFile(flatid), "GenerateFlats", .bExtra = true, .extra = playerid);
  21.         }
  22.         else
  23.         {
  24.             SendClientMessage(playerid,-1,"nope");
  25.         }
  26.         return 1;
  27. }
  28.  
  29. forward GenerateFlats(flatid, name[],value[]);
  30. public GenerateFlats(flatid, name[],value[]) //Load the float "Enter X" saved in "1.txt" into FlatInfo[flatid][FlatEnterX]
  31. {
  32.     INI_Float("Enter X", FlatInfo[flatid][FlatEnterX]);
  33.     return 1;
  34. }
  35.  
  36. stock fFile(flatid)
  37. {
  38.     new FlatFile[64];
  39.     format(FlatFile,sizeof(FlatFile),FLATPATH,flatid);
  40.     return FlatFile;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment