11.01.2012, 06:42
Here you have
Код:
} CheckPH(playerid) { if(PlayerInfo[playerid][pPnumber] == 0) {return 0;} new PHList[256]; new number; new string[512]; if(!fexist("PHList.cfg")) makefamily("PHList.cfg"); new File: file = fopen("PHList.cfg", io_read); if (file) { while(fread(file, string)) { strmid(PHList, string, 0, strlen(string)-2, 255); number = strval(PHList); if (number == PlayerInfo[playerid][pPnumber]) { fclose(file); return 1; } } fclose(file); new File: file2 = fopen("PHList.cfg", io_append); format(string, sizeof(string), "%d\r\n", PlayerInfo[playerid][pPnumber]); fwrite(file2, string); fclose(file2); printf("New number added to PHList.cfg, ph:%d player:%s", PlayerInfo[playerid][pPnumber], GetPlayerNameEx(playerid)); return 0; } return 1; }