05.11.2018, 13:14
Code:
#define MAX_PLACAS 500 new string[32]; tryagain: format(string, sizeof string, "carros/carro %s.ini", generateUniquePlaque(MAX_PLACAS)); if(!DOF2_FileExists(string)) { // Salvar dados; } else goto tryagain; generateUniquePlaque(MAX_PLACAS) { static str[10]; format(str, sizeof str, "%s%s%s-%04d", randomChar(), randomChar(), randomChar(), random(10000)); MAX_PLACAS ++; return str; } randomChar() { static c[2]; format(c, 2, "%c", random(26) + 'A'); return c; }