Heres what I have right now but still it crashes my cs.
Code:
check_cfgfile(Map[], rFile[], rLen)
{
new BaseDir[64]
get_basedir(BaseDir, 63)
new File[64]
format(File, 63, "%s/configs/xxxx.cfg", BaseDir)
new ReturnS
if(file_exists(File))
{
new Text[64], TgaFile[64], Line, len = 0
while(read_file(File, Line, Text, 63, len))
{
if((Text[0] == ';') || !len)
continue
parse(Text, 63, TgaFile, 63)
if(equali(Text, Map, 63))
{
ReturnS = format(rFile , rLen , TgaFile)
break
}
else
{
ReturnS = format(rFile , rLen , "")
}
}
}
return ReturnS
}
The function that calls it
Code:
public test(id)
{
new Map[64]
get_mapname(Map, 63)
new TgaFile[64], File
File = check_precache(Map, TgaFile, 63)
client_print(id, print_chat, "%s", File)
}
What I have in the cfg file
Code:
de_dust test_
de_dust2 test2_
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.