16.10.2011, 12:18
PHP код:
public LoadAnticheat() //20039
{
new arrCoords[12][64];
new strFromFile2[128];
new File: file = fopen("LARP/anticheat.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
AntiBunnyJump = strval(arrCoords[0]);
AntiWeaponHack = strval(arrCoords[1]);
AntiMoneyHack = strval(arrCoords[2]);
AntiInteriorHack = strval(arrCoords[3]);
AntiJetpackHack = strval(arrCoords[4]);
AntiAfk = strval(arrCoords[5]);
AntiName = strval(arrCoords[6]);
AntiDriveBy = strval(arrCoords[7]);
AntiFakeKill = strval(arrCoords[8]);
AntiHighPing = strval(arrCoords[9]);
MaxPing = strval(arrCoords[10]);
AntiSpam = strval(arrCoords[11]);
fclose(file);
}
else
{
fopen("LARP/anticheat.ini", io_write);
print("[ERROR]: anticheat.ini wasn't found in scriptfiles/LARP, Creating it NOW");
SaveAnticheat();
fclose(file);
}
return 1;
}
--------------------
strtok(const string[], &index)
{ //25132
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}