21.02.2019, 18:33
PHP код:
// array starts at 0 instead of 1, so it is 0-10 instead of 1-11
dini_Set(file, "Pay1", FacInfo[1][fPay][0]);
dini_Set(file, "Pay2", FacInfo[1][fPay][1]);
dini_Set(file, "Pay3", FacInfo[1][fPay][2]);
// ...
dini_Set(file, "Pay9", FacInfo[1][fPay][8]);
dini_Set(file, "Pay10", FacInfo[1][fPay][9]);
dini_Set(file, "Pay11", FacInfo[1][fPay][10]);
PHP код:
for(new i = 0, key[16] = "Pay"; i <= 10; ++i) {
valstr(key[3], i + 1); // faster than format
dini_Set(file, key, FacInfo[1][fPay][i]); // dini is quite old and slow
// if you feel that your SaveFactions takes to long try to update to a newer filesystem or use a database
}
PHP код:
format(file, sizeof(file), "factions/LSPD.ini");