hi everyone,
okay i've tried a couple of ways to execute config files but sometimes they just seem not to work and sometimes it get message like server cannot execute chosen cfg file or just act like its missing ..
so here is how i did it and it's kind of wired to me cause it does work for some other plugins:
PHP Code:
char Cfgname[32];
Cfgname= "cfg/files/file.cfg";
ServerCommand("exec %s", Cfgname);
PrintToServer("[SM] CFG File has been executed!");
so it does not work sometimes and i don't know why and i probably tried this seconds way but it seems still nothing:
PHP Code:
stock void ExecuteCfg(char[] Path)
{
Handle hFile = OpenFile(Path, "r");
char PathOfFile[256];
while(!IsEndOfFile(hFile) && ReadFileLine(hFile, PathOfFile, sizeof(PathOfFile)))
{
ServerCommand(PathOfFile);
PrintToServer("[SM] Command %s Executed.", PathOfFile);
}
CloseHandle(hFile);
}
and just
ExecuteCfg(Cfgname);
and i see it's not working cause it's not showing the PrintToServer Message.
what i'm saying is how to do it without such errors and 100% working, thank you.
Note: i'm pretty sure that cfg file exists.
__________________