18.05.2015, 16:45
SetPlayerWeather doens't update the weather with the latest release.
If you have correct object sizes then I will update plugin. But I don't know how to get sizes for new objects. I just put Y_Less include into this plugin, that's all.
|
I believe the modelsizes include just uses the data provided by rockstar, however I will see if I can get a solution to get the new sizes for the 0.3.7 objects.
|
Use ColAndreas's bounding sphere function, it returns exact sizes and offsets. Plus you could always update the list when new objects are added by samp versions. I could make a script for it if you want, but I'm sure you know how simple it is.
Also, the sizes in modelsizes.inc are not from R*, Kalcor exported the sizes himself (but as we know, most of those sizes are off by a bit, some a lot). |
They are accurate enough for some tasks, as we sometimes only need vague sizes to accomplish the task. Also I don't want to have another plugin aside of YSF, as I have no need for everything else in ColAndreas.
|
I believe he is hinting that we can use it to generate the offsets for the new objects(correct me if I am wrong), and then export that data into the YSF plugin.
|
CA_GetModelBoundingSphere(modelid, &Float:offx, &Float:offy, &Float:offz, &Float:radius);
stock StoreAsArray(model1, model2) {
new Float: x, Float: y, Float: z, Float: radius, bufferstring[300], string[126];
for (new i = model1; i != model2; ++i)
{
CA_GetModelBoundingSphere(model1, x, y, z, radius);
format(string, sizeof string, ",%f, %f, %f", x, y, z);
strcat(bufferstring, string, sizeof(bufferstring));
}
printf(bufferstring);
new File: handle = fopen("offsets.txt");
if(handle) {
fwrite(handle, bufferstring);
fclose(handle);
}
return bufferstring;
}
I didn't know there was a plug and play method for that, that part of storing the data shouldn't be a difficult task, e.g:
pawn Код:
|
new Line[2][512], Float:oX, Float:oY, Float:oZ, Float:R, File:Sizes = fopen("sizes.txt", io_append), File:Offsets = fopen("offsets.txt", io_append); for(new row; row < 1000; row++) { Line[0][0] = EOS; Line[1][0] = EOS; strcat(Line[0], "\t\t"); strcat(Line[1], "\t\t"); for(new col; col < 20; col++) { CA_GetModelBoundingSphere((row * 1000) + col, oX, oY, oZ, R); strcat(Line[0], sprintf("%0.6f, ", R)); strcat(Line[1], sprintf("{%0.6f, %0.6f, %0.6f}, ", oX, oY, oZ)); } strcat(Line[0], "\r\n"); strcat(Line[1], "\r\n"); fwrite(Sizes, Line[0]); fwrite(Offsets, Line[1]); } fclose(Sizes); fclose(Offsets);
stock const Float:MODELS_gColRadius[20000] = { //EVERYTHING from sizes.txt here. }, Float:MODELS_gColOffset[20000][3] = { //EVERYTHING from offsets.txt here. };
Yes but I don't understand how the data is actually stored, what is the starting object etc, and I think it'd be easier to just store all the variables in one LARGE string, and then print it to the file - no need to write every loop.
|
new Line[2][1536], Float:oX, Float:oY, Float:oZ, Float:R, File:Sizes = fopen("sizes.txt", io_append), File:Offsets = fopen("offsets.txt", io_append); for(new row; row < 1000; row++) { Line[0][0] = EOS; Line[1][0] = EOS; strcat(Line[0], "\t\t"); strcat(Line[1], "\t\t"); for(new col; col < 20; col++) { CA_GetModelBoundingSphere((row * 20) + col, oX, oY, oZ, R); strcat(Line[0], sprintf("%0.6f, ", R)); strcat(Line[1], sprintf("{%0.6f, %0.6f, %0.6f}, ", oX, oY, oZ)); printf("[%i] R: %0.6f S: %0.6f, %0.6f, %0.6f", (row * 20) + col, oX, oY, oZ, R); } strcat(Line[0], "\r\n"); strcat(Line[1], "\r\n"); fwrite(Sizes, Line[0]); fwrite(Offsets, Line[1]); } fclose(Sizes); fclose(Offsets);