Hi!
I'm updating my plugin "Point - System" to the new file system.
Though I've never worked with the new system before so I got a problem.
The problem is within the following code.
Nothing is written to the file even when everything is correct.
With correct I mean file location, strings, variables.
I've logged everything therefor I've seen it's correct.
But still, the information won't get written to the file:
PHP Code:
add_points(index, points, sound = 1)
{
if(is_ps_on())
{
if(is_false_user(index))
return;
static steamid[2][MAX_LENGTH + 1];
static name[MAX_LENGTH + 1], readdata[128];
get_user_name(index, name, MAX_LENGTH);
get_user_authid(index, steamid[ACTIVE], MAX_LENGTH);
if(g_check[index])
{
new current = get_points(index);
current += points;
new fp = fopen(filedir1, "a+");
if(fp)
{
while(fgets(fp, readdata, 127))
{
parse(readdata, steamid[PARSED], MAX_LENGTH);
if(containi(steamid[PARSED], ";") != -1) continue;
if(equal(steamid[ACTIVE], steamid[PARSED]))
fprintf(fp, "%s %d ; ^"%s^"", steamid[ACTIVE], current, name); // This is executed but It's not any difference in the file.
}
}
fclose(fp);
}
if(sound && get_pcvar_num(ps_sound))
client_cmd(index, "spk %s", g_sound_add);
}
}
__________________