I tried to do it but I am not sure that where is the mistake. And also I couldn't use "fprintc" "fputs" commands perfectly.
PHP Code:
public DeleteButton(ent)
{
new filehandle = fopen(filename, "rt");
new data[128], PurposeLess[600];
if(filehandle)
{
while(!feof(filehandle))
{
fgets(filehandle, data, charsmax(data));
trim(data);
g_iButtons[g_iButtonCounter] = str_to_num(data);
if(g_iButtons[g_iButtonCounter] == ent)
{
continue;
}
copy(g_iButtons, charsmax(g_iButtons), PurposeLess);
}
fclose(filehandle);
}
filehandle = fopen(filename, "rt");
if(filehandle)
{
while(!feof(filehandle))
{
fgets(filehandle, data, charsmax(data));
trim(data);
g_iButtons[g_iButtonCounter] = str_to_num(data);
replace_all(data, charsmax(data), g_iButtons[g_iButtonCounter], "");
//fprintf(filename, PurposeLess);
//AGAIN WRONG NUMBER [ Puts all buttons to file again ]
}
fclose(filehandle);
}
}
May you give an example?