Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //save plantation data
- new buffer[plantareaInfo], i=1;
- LIST::foreach<node>(paList)
- {
- MEM::get_arr(LIST_IT::data_ptr(node), _, buffer);
- mysql_format(connection, query, sizeof(query), "UPDATE Plantations SET pX = '%f', pY = '%f', pZ = '%f', pR = '%f', pTotalPlants = '%d' WHERE pID = '%d'", buffer[CoordX], buffer[CoordY], buffer[CoordZ], buffer[radius], buffer[totalplants], i++);
- }
- //load plantation data
- for(new i=0;i<cache_num_rows();i++)
- {
- new buffer[plantareaInfo]; //not sure, but I think it is needed to start a new variable for every single one plantation, that's why this is inside the loop.
- buffer[CoordX]=cache_get_field_content_float(i,"pX");
- buffer[CoordY]=cache_get_field_content_float(i,"pY");
- buffer[CoordZ]=cache_get_field_content_float(i,"pZ");
- buffer[radius]=cache_get_field_content_float(i,"radius");
- buffer[totalplants]=cache_get_field_content_int(i,"totalplants");
- buffer[currentplants]=0;
- LIST::push_back_arr(paList,buffer); //puts into the list of Business this new Business
- }
Advertisement
Add Comment
Please, Sign In to add comment