if(strcmp(cmd, "/why", true) == 0){ new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "GEBRUIK: /why [playerName]"); return 1; } //format(string, sizeof(string), "[why] %d %s", playerid, tmp); //AddEcho(string); new File:gFile = fopen("kblog.txt", io_read); new line[256]; new count = 0; format(string, sizeof(string), "Usernotes of %s:", tmp); SendClientMessage(playerid, COLOR_YELLOW, string); new index; new why_what[256]; new why_date[256]; new why_by[256]; new why_reason[256]; while(fread(gFile, line, 256)) { //AddEcho(line); if (count == 5) { return 1; } format(string, sizeof(string), "%s ::", tmp); if (strfind(line,string,true) != -1) { index=0; why_what = strtok(line, index); why_what = strreplace("[", "", why_what); why_what = strreplace("]", "", why_what); format(why_date, sizeof(why_date), "%s %s", strtok(line, index), strtok(line, index)); why_by = strtok(line, index); tmp = strtok(line, index); why_reason = strtok(line, index); why_reason = strrest(line, index); format(string, sizeof(string), "%s %s: %s (%s)", why_date, why_what, why_reason, why_by); SendClientMessage(playerid, COLOR_WHITE, string); count++; } } if (count == 0) { format(string, sizeof(string), "No usernotes found for %s.", tmp); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; }