03.04.2009, 23:55
Hey,
first
im loading a name and description from a mysql database, wuts wrong (i got this from file based shit :P)
and im loading positions, but they dont load properly they go ingame to 0.0 0.0 0.0..
first
im loading a name and description from a mysql database, wuts wrong (i got this from file based shit :P)
and im loading positions, but they dont load properly they go ingame to 0.0 0.0 0.0..
pawn Код:
public LoadHouse(houseid)
{
MySQLConnect();
new Data[1024];
new Field[64];
new rcnt = 1;
format(query, sizeof(query), "SELECT * FROM houses WHERE house_id = '%d' LIMIT 1", houseid); samp_mysql_query(query); samp_mysql_store_result();
samp_mysql_strtok(Field, "|", Data);
while (samp_mysql_strtok(Field, "|", "")==1)
{
if(rcnt == 2) Houses[houseid][ex] = strval(Field);
if(rcnt == 3) Houses[houseid][ey] = strval(Field);
if(rcnt == 4) Houses[houseid][ez] = strval(Field);
if(rcnt == 5) Houses[houseid][xx] = strval(Field);
if(rcnt == 6) Houses[houseid][xy] = strval(Field);
if(rcnt == 7) Houses[houseid][xz] = strval(Field);
if(rcnt == 16) strmid(Houses[houseid][owner], Field, 0, strlen(Field), 255);
if(rcnt == 17) strmid(Houses[houseid][descr], Field, 0, strlen(Field), 255); // Deleted other variables because you wont need em ;D
rcnt++;
}
samp_mysql_free_result();
}