18.03.2012, 14:00
this is the stock
i did the same thing for my dynamic job and organization where the Vehicle spawns but for this it wont spawn.
pawn Код:
stock LoadCars()
{
new barcount;
for(new i=1; i<MAX_CARS; i++)
{
format(query,sizeof(query),"SELECT * FROM `Dealership` WHERE `ID` = '%d'",i);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
barcount ++;
mysql_fetch_row_format(drow, "|");
explode(drow, field, "|");
DealerInfo[i][dID] = strval(field[0]);
DealerInfo[i][Model] = strval(field[1]);
DealerInfo[i][PosX] = floatstr(field[2]);
DealerInfo[i][PosY] = floatstr(field[3]);
DealerInfo[i][PosZ] = floatstr(field[4]);
DealerInfo[i][Ccolor1] = strval(field[5]);
DealerInfo[i][Ccolor2] = strval(field[6]);
DealerInfo[i][Aangle] = strval(field[7]);
DealerInfo[i][Cost] = strval(field[8]);
DealerInfo[i][Car] = CreateVehicle(DealerInfo[i][Model],DealerInfo[i][PosX],DealerInfo[i][PosY],DealerInfo[i][PosZ],DealerInfo[i][Aangle],DealerInfo[i][Ccolor1],DealerInfo[i][Ccolor2],60);
format(str,sizeof(str),"{FF9900}Car ID:{FFFFFF} %d\n{FF9900}Cost:{FFFFFF} %d",DealerInfo[i][dID],DealerInfo[i][Cost]);
DealerInfo[i][dlabel] = Create3DTextLabel(str,-1,X,Y,Z,100,-1,0);
Attach3DTextLabelToVehicle(DealerInfo[i][dlabel],DealerInfo[i][Car],0,0,0);
mysql_free_result();
}
}
return printf("%d dealership cars loaded",barcount);
}