17.08.2013, 04:07
pawn Код:
stock Float:db_get_field_float(DBResult:dbrResult, iField = 0) {
if (dbrResult == DB::INVALID_RESULT) {
DB::Notice("(db_get_field_float) Invalid result given.");
return 0.0;
}
if (!db_num_rows(dbrResult)) {
DB::Notice("(db_get_field_int) Empty result given.");
return 0.0;
}
if (iField < 0 || db_num_fields(dbrResult) <= iField) {
DB::Notice("(db_get_field_int) Given field index doesn't exist in the result.");
return 0.0;
}
db_get_field(dbrResult, iField, gs_szBuffer, sizeof(gs_szBuffer) - 1);
return floatstr(gs_szBuffer);
}