19.06.2012, 07:46
(
Последний раз редактировалось Fly_luck; 20.06.2012 в 10:41.
)
Hey guys,
I've been working on an object editing system and tried to filter out all invalid objects models by this IsValidModel function written by ******(maybe it's been few years?).
It worked perfectly as usually for object models ranging from 321 to 18630(or similar?) which were in samp before 0.3c,however,IT FILTERED OUT ALL 830 OBJECTS ADDED IN SAMP SINCE 0.3c(18630 ~ 19515)!
I do need to keep those new object models but I am unable to figure out how 'IsValidModel' works thus I can't modify it at all!
Has somebody came across the same problem or have any idea how to solve it?Please post here buddies!
I wonder whether the following code should be updated(or update available but I haven't found it?) in YSI system or something?
Here's the code 'IsValidModel':
P.S.I have searched the forum serveral times by key words 'IsValid','IsValidModel','IsValidObject' but found nothing helpful.
I've been working on an object editing system and tried to filter out all invalid objects models by this IsValidModel function written by ******(maybe it's been few years?).
It worked perfectly as usually for object models ranging from 321 to 18630(or similar?) which were in samp before 0.3c,however,IT FILTERED OUT ALL 830 OBJECTS ADDED IN SAMP SINCE 0.3c(18630 ~ 19515)!
I do need to keep those new object models but I am unable to figure out how 'IsValidModel' works thus I can't modify it at all!
Has somebody came across the same problem or have any idea how to solve it?Please post here buddies!
I wonder whether the following code should be updated(or update available but I haven't found it?) in YSI system or something?
Here's the code 'IsValidModel':
pawn Код:
IsValidModel(modelid)
{
// Created by ******.
static modeldat[] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -128,
-515899393, -134217729, -1, -1, 33554431, -1, -1, -1, -14337, -1, -33,
127, 0, 0, 0, 0, 0, -8388608, -1, -1, -1, -16385, -1, -1, -1, -1, -1,
-1, -1, -33, -1, -771751937, -1, -9, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 33554431, -25, -1, -1, -1, -1, -1, -1,
-1073676289, -2147483648, 34079999, 2113536, -4825600, -5, -1, -3145729,
-1, -16777217, -63, -1, -1, -1, -1, -201326593, -1, -1, -1, -1, -1,
-257, -1, 1073741823, -133122, -1, -1, -65, -1, -1, -1, -1, -1, -1,
-2146435073, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1073741823, -64, -1,
-1, -1, -1, -2635777, 134086663, 0, -64, -1, -1, -1, -1, -1, -1, -1,
-536870927, -131069, -1, -1, -1, -1, -1, -1, -1, -1, -16384, -1,
-33554433, -1, -1, -1, -1, -1, -1610612737, 524285, -128, -1,
2080309247, -1, -1, -1114113, -1, -1, -1, 66977343, -524288, -1, -1, -1,
-1, -2031617, -1, 114687, -256, -1, -4097, -1, -4097, -1, -1,
1010827263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32768, -1, -1, -1, -1, -1,
2147483647, -33554434, -1, -1, -49153, -1148191169, 2147483647,
-100781080, -262145, -57, 134217727, -8388608, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1048577, -1, -449, -1017, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1835009, -2049, -1, -1, -1, -1, -1, -1,
-8193, -1, -536870913, -1, -1, -1, -1, -1, -87041, -1, -1, -1, -1, -1,
-1, -209860, -1023, -8388609, -2096897, -1, -1048577, -1, -1, -1, -1,
-1, -1, -897, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1610612737,
-3073, -28673, -1, -1, -1, -1537, -1, -1, -13, -1, -1, -1, -1, -1985,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1056964609, -1, -1, -1,
-1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-236716037, -1, -1, -1, -1, -1, -1, -1, -536870913, 3, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -2097153, -2109441, -1, 201326591, -4194304, -1, -1,
-241, -1, -1, -1, -1, -1, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, -32768, -1, -1, -1, -2, -671096835, -1, -8388609, -66323585, -13,
-1793, -32257, -247809, -1, -1, -513, 16252911, 0, 0, 0, -131072,
33554383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8356095, 0, 0, 0, 0, 0,
0, -256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-268435449, -1, -1, -2049, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
92274627, -65536, -2097153, -268435457, 591191935, 1, 0, -16777216, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 127
};
if ((modelid >= 0) && ((modelid / 32) < sizeof (modeldat)) && (modeldat[modelid / 32] & (1 << (modelid % 32))))
{
return 1;
}
return 0;
}