26.05.2010, 14:59
I have created a MySQL database with all my cars for the server. Structure goes like this: type, vehid, x, y, z, o, color1, color2. I'm not a superawesome scripter, so..
This is my code:
When I start the server it spams messages about vehicles getting loaded, but I can't see them IG.
This is my code:
Код:
case VEHICLE_LOAD: { mysql_store_result(SQLPtr); if(extraid == 333) { printf("MySQL Vehicle Rows: %d", mysql_num_rows(SQLPtr)); for(new c = 0; c < mysql_num_rows(SQLPtr); c++) { format(string, sizeof(string), "SELECT * FROM vehicles WHERE type = '%d'", c); mysql_query(string, VEHICLE_LOAD); } } new id,model,Float:x,Float:y,Float:z,Float:o,c1,c2, idx; mysql_fetch_row_format(string, " ", SQLPtr); id = strval(strtok(string, idx)); strval(strtok(string,idx)); model = strval(strtok(string, idx)); x = strval(strtok(string, idx)); y = strval(strtok(string, idx)); z = strval(strtok(string, idx)); o = strval(strtok(string, idx)); c1 = strval(strtok(string, idx)); c2 = strval(strtok(string, idx)); CreateVehicle(model,x,y,z,o,c1,c2, 300); }