16.05.2017, 21:15
PHP код:
stock GetBizEmptyID(const len)
{
new id = (-1);
for(new loop = (0), check= (-1), Data_[64] = "\0"; loop != len; ++ loop)
{
check= (loop+1);
format(Data_, (sizeof Data_), "BIZS/Biz_%d.ini", check);
if(!fexist(Data_))
{
id = (check);
break;
}
}
return (id);
}
I'm using this function on commande makebusiness:
new bizid = GetFirmaEmptyID(MAX_BIZ);
And than I use that bizid to make new business:
BusinessInfo[bizd][bInfo] = ...;
I have in BusinessInfo enum main SQLID that I can use for businesses ID but don't know how to make it work in mysql. Just transfered my gamemode from ini to mysql and still learning.