void CALLBACK addAdmCMD(std::string param)
{
if (param.empty()) return SF->getSAMP()->getChat()->AddChatMessage(-1, "Используйте: /addadm [ник]");
char nick[SAMP_MAX_PLAYER_NAME];
if (sscanf(param.c_str(), "%s", &nick))
{
FILE *fp;
char WorkingDir[MAX_PATH], IniFile[MAX_PATH];
GetCurrentDirectory(_countof(WorkingDir), WorkingDir);
sprintf_s(IniFile, "%s\\SAMPFUNCS\\artsob\\admins.ini", WorkingDir);
fp = fopen(IniFile, "r");
if (fp)
{
for (int i = NULL; i < 50; i++)
{
char buf[SAMP_MAX_PLAYER_NAME];
if (!fgets(buf, SAMP_MAX_PLAYER_NAME, fp))
{
fwrite(nick, SAMP_MAX_PLAYER_NAME, i, fp);
SF->getSAMP()->getChat()->AddChatMessage(-1, "Записан");
sprintf(admin_list[i], "%s", nick);
break;
}
else
continue;
}
}
}
return;
}