10.04.2014, 14:40
this...
pawn Код:
stock OdrediAdresu(houseid, number)
{
new string[128];
for(new h = 0; h < MAX_HOUSES; h++)
{
if(HouseInfo[houseid][hZone] == HouseInfo[h][hZone] && number == HouseInfo[h][hNumber])
{
number++;
return OdrediAdresu(houseid, number);
}
}
HouseInfo[houseid][hNumber] = number;
format(string, sizeof string, "%d", number);
print(string);
format(string, sizeof string, "%s", HouseInfo[houseid][hZone]);
print(string);
format(HouseInfo[houseid][hAdresa], 32, "%s %d", HouseInfo[houseid][hZone], HouseInfo[houseid][hNumber]);
format(string, sizeof string, "%s", HouseInfo[houseid][hAdresa]);
print(string);
new Query[384];
format(Query, sizeof(Query), "UPDATE HOUSES SET ADRESA = '%s' WHERE ID = %d ", HouseInfo[houseid][hAdresa], houseid);
db_query(Database, Query);
return 1;
}