17.11.2014, 15:55
I made this code for check if is any empty slot used. I made one stock for enter to Database and look if there is any column with the ID, if is empty it break the loop and return the value that found, but it send to me one warning.
I use the break for stop the loop if found one.
I use the break for stop the loop if found one.
pawn Код:
stock ComprobarSlot(SlotLibre)
{
for(new i =0; i < MAX_VEHICLES; i++)
{
new solicitud[254];
format(solicitud, sizeof(solicitud), "SELECT * FROM `vehiculos` WHERE %d");
mysql_query(mysql, solicitud);
new columnas, filas;
cache_get_data(columnas, filas);
if(!columnas)
{
break;
return SlotLibre;
}
}
return 1;
}