Плиз подскажите почему файл stat.txt обновляется даже если игрок уже есть в статистике
Code
public OnClientPutInServer(i)
{
GetClientAuthString(i, SteaM[i], 20);
kv = CreateKeyValues("stat");
if(KvJumpToKey(kv, SteaM[i]))
{
h[i] = KvGetNum(kv, "H");
reghp[i] = KvGetNum(kv, "reghp");
s[i] = KvGetFloat(kv, "s");
sp[i] = KvGetNum(kv, "sp");
points[i] = KvGetNum(kv, "points");
inf[i] = KvGetNum(kv, "inf");
d[i] = KvGetNum(kv, "d");
regammo[i] = KvGetNum(kv, "regammo");
}
else
{
kv = CreateKeyValues("stat");
h[i] = 0;
s[i] = 1.0;
points[i] = 1000;
inf[i] = 10;
sp[i] = 0;
d[i] = 0;
regammo[i] = 0;
reghp[i] = 0;
KvJumpToKey(kv, SteaM[i], true);
KvSetNum(kv, "h", 0);
KvSetNum(kv, "d", 0);
KvSetNum(kv, "regammo", 0);
KvSetNum(kv, "sp", 0);
KvSetNum(kv, "inf", 10);
KvSetNum(kv, "points", 1000);
KvSetNum(kv, "reghp", 0);
KvSetFloat(kv, "s", 1.0);
KvRewind(kv);
}
KeyValuesToFile(kv, "stat.txt");
CloseHandle(kv);
}