native File:fopen(const name[], filemode: mode = io_readwrite);
native bool:fclose(File: handle);
native File:ftemp();
native bool:fremove(const name[]);
native fwrite(File: handle, const string[]);
native fread(File: handle, string[], size = sizeof string, bool: pack = false);
native bool:fputchar(File: handle, value, bool: utf8 = true);
native fgetchar(File: handle, value, bool: utf8 = true);
native fblockwrite(File: handle, const buffer[], size = sizeof buffer);
native fblockread(File: handle, buffer[], size = sizeof buffer);
native fseek(File: handle, position = 0, seek_whence: whence = seek_start);
native flength(File: handle);
native fexist(const pattern[]);
native bool:fmatch(name[], const pattern[], index = 0, size = sizeof name);
//you can find what each function does in Samp-Wiki.
//writting
new Name[28];
GetPlayerName(playerid, Name, 24);
format(Name, sizeof(Name), "%s.ini", Name);
new File:newfile = fopen(Name, io_write);
if(Computer[playerid] == true)
fwrite(newfile, "Computer=Yes");
if(Phone[playerid] == true)
fwrite(newfile, "Phone=Yes");
fclose(newfile);
//reading
new Name[28];
GetPlayerName(playerid, Name, 24);
format(Name, sizeof(Name), "%s.ini", Name);
if(!fexist(Name)) return 1;
new File:newfile = fopen(Name, io_read);
new string[128];
fread(newfile, string);
if(strfind(string, "Computer=Yes") != -1)
Computer[playerid] = true;
if(strfind(string, "Phone=Yes") != -1)
Phone[playerid] = true;
fclose(newfile);
Store for example if people got thing or not, what i want to make is something like:
Computer: (If the player got a computer or not) Phone: (If the player got a phone or not) Things like that ![]() |
Originally Posted by cruteX_modshop
EDIT: Yes i mean store things in file. But can you show it without SII? :P
|