this work but remove all other paths!!!!!!!
Code:
char *SU_Get_FileText(char *text)
{
char *pch = text;
pch = strtok(pch,"/");
char *oldpch = text;
while (pch != NULL)
{
oldpch = pch;
pch = strtok (NULL, "/");
}
return oldpch;
}
void SU_File_Remove(const char *filename)
{
char *newfile = SU_Get_FileText((char *)filename);
Msg("FILE: %s\n",filename);
if(newfile[0] != 's' || newfile[1] != 'u' || newfile[2] != '_')
StrReplace((char *)filename,newfile,UTIL_VarArgs("su_%s",newfile),sizeof(char *));
Msg("FILE: %s\n",filename);
if(!filesystem->FileExists(filename,"MOD"))
{
Msg("SU: File '%s' Not Exists\n",filename);
return ;
}
filesystem->RemoveFile(filename,"MOD");
}
after in game!!
Quote:
] su_file remove cfg/s.cfg
FILE: cfg
FILE: cfg
Unable to remove h:\bck200\caza\jogos\servers\cstrike\cfg!
|
i have debuged "newfile" too and say correct file
newfile = s.cfg
why this happen!?