hallo ich finde den fehler net warum mein object system net geht were dankbar wenn jmd ma rüber gugt
die spawn sind ingame net vorhanden
hier der code
stock Loadobject()
{
new strFromDb[256];
new modelid;
new Float:pos_ox, Float:pos_oy, Float:pos_oz,Float:pos_rx, Float:pos_ry, Float:pos_rz;
new z[128];
format(z,sizeof(z),"SELECT COUNT(*) FROM object");
mysql_query(z);
mysql_store_result();
mysql_fetch_row_format(strFromDb);
new SizeOfVeh = strval(strFromDb);
for(new i = 0; i < SizeOfVeh; i++)
{
new obsql[128],resultline[64];
format(obsql,sizeof(obsql),"SELECT * FROM object LIMIT %d, 1", i);
mysql_query(obsql); mysql_store_result();
if(mysql_fetch_row_format(resultline))
{
mysql_fetch_field_row(obsql,"modelid"); modelid = strval(obsql);
mysql_fetch_field_row(obsql,"pos_x"); pos_ox = strval(obsql);
mysql_fetch_field_row(obsql,"pos_y"); pos_oy = strval(obsql);
mysql_fetch_field_row(obsql,"pos_z"); pos_oz = strval(obsql);
mysql_fetch_field_row(obsql,"pos_rx"); pos_rx = strval(obsql);
mysql_fetch_field_row(obsql,"pos_ry"); pos_ry = strval(obsql);
mysql_fetch_field_row(obsql,"pos_rz"); pos_rz = strval(obsql);
}
if (mysql_num_rows() > 0)
{
CreateObject(modelid,pos_ox,pos_oy,pos_oz,pos_rx,pos_ry,pos_rz);
printf("Model %d pos_x %f pos_y %f pos_z %f pos_rx %f pos_ry %f pos_rz ",modelid,pos_ox,pos_oy,pos_oz,pos_rx,pos_ry,pos_rz);
}
}
return 1;
}
und sql
CREATE TABLE `object` (
`id` int(32) NOT NULL AUTO_INCREMENT,
`modelid` int(32) NOT NULL,
`pos_x` varchar(50) DEFAULT NULL,
`pos_y` varchar(50) DEFAULT NULL,
`pos_z` varchar(50) DEFAULT NULL,
`pos_rx` varchar(50) DEFAULT NULL,
`pos_ry` varchar(50) DEFAULT NULL,
`pos_rz` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=676 DEFAULT CHARSET=latin1;
Alles anzeigen