18.07.2015, 22:42
PHP код:
public OnGameModeInit() {
if ( !fexist("last_id.txt") ) {
new File:handle = fopen("last_id.txt", io_write);
fwrite(handle, "1000");
fclose(handle);
}
return 1;
}
// na hora de criar a conta ...
new myID, file_data[11];
new File:handle = fopen("last_id.txt", io_readwrite);
fread(handle, file_data);
myID = strval(file_data);
format(file_data, 11, "%d", (myID + 1) );
fwrite(handle, file_data);
fclose(handle);
// a variбvel myID armazenarб o ID do novo registrado