Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FLATPATH "Flats/%d.txt"
- enum fInfo
- {
- FlatID,
- Float:FlatEnterX,
- Float:FlatEnterY,
- Float:FlatEnterZ
- };
- new FlatInfo[MAX_FLATS][fInfo];
- [...]
- forward LoadFlats(playerid);
- public LoadFlats(playerid)
- {
- new flatid;
- flatid = 1; //Tempoary flat ID to test the script
- if(fexist(fFile(flatid))) //if the file with name "1" in Scriptfiles/Flats exists:
- {
- SendClientMessage(playerid,-1,"Attempting to load flat file");
- INI_ParseFile(fFile(flatid), "GenerateFlats", .bExtra = true, .extra = playerid);
- }
- else
- {
- SendClientMessage(playerid,-1,"nope");
- }
- return 1;
- }
- forward GenerateFlats(flatid, name[],value[]);
- public GenerateFlats(flatid, name[],value[]) //Load the float "Enter X" saved in "1.txt" into FlatInfo[flatid][FlatEnterX]
- {
- INI_Float("Enter X", FlatInfo[flatid][FlatEnterX]);
- return 1;
- }
- stock fFile(flatid)
- {
- new FlatFile[64];
- format(FlatFile,sizeof(FlatFile),FLATPATH,flatid);
- return FlatFile;
- }
Advertisement
Add Comment
Please, Sign In to add comment