[Tutorial] Perfect Protection against invalid mods.
#1

pawn Код:
// Table of legit mods (minus NOS, hydraulic and wheels) for specific vehicles.
    new legalmods[48][22] = {
        {400, 1024,1021,1020,1019,1018,1013,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {401, 1145,1144,1143,1142,1020,1019,1017,1013,1007,1006,1005,1004,1003,1001,0000,0000,0000,0000},
        {404, 1021,1020,1019,1017,1016,1013,1007,1002,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {405, 1023,1021,1020,1019,1018,1014,1001,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {410, 1024,1023,1021,1020,1019,1017,1013,1007,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000},
        {415, 1023,1019,1018,1017,1007,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {418, 1021,1020,1016,1006,1002,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {420, 1021,1019,1005,1004,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {421, 1023,1021,1020,1019,1018,1016,1014,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {422, 1021,1020,1019,1017,1013,1007,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {426, 1021,1019,1006,1005,1004,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {436, 1022,1021,1020,1019,1017,1013,1007,1006,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000},
        {439, 1145,1144,1143,1142,1023,1017,1013,1007,1003,1001,0000,0000,0000,0000,0000,0000,0000,0000},
        {477, 1021,1020,1019,1018,1017,1007,1006,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {478, 1024,1022,1021,1020,1013,1012,1005,1004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {489, 1024,1020,1019,1018,1016,1013,1006,1005,1004,1002,1000,0000,0000,0000,0000,0000,0000,0000},
        {491, 1145,1144,1143,1142,1023,1021,1020,1019,1018,1017,1014,1007,1003,0000,0000,0000,0000,0000},
        {492, 1016,1006,1005,1004,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {496, 1143,1142,1023,1020,1019,1017,1011,1007,1006,1003,1002,1001,0000,0000,0000,0000,0000,0000},
        {500, 1024,1021,1020,1019,1013,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {516, 1021,1020,1019,1018,1017,1016,1015,1007,1004,1002,1000,0000,0000,0000,0000,0000,0000,0000},
        {517, 1145,1144,1143,1142,1023,1020,1019,1018,1017,1016,1007,1003,1002,0000,0000,0000,0000,0000},
        {518, 1145,1144,1143,1142,1023,1020,1018,1017,1013,1007,1006,1005,1003,1001,0000,0000,0000,0000},
        {527, 1021,1020,1018,1017,1015,1014,1007,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {529, 1023,1020,1019,1018,1017,1012,1011,1007,1006,1003,1001,0000,0000,0000,0000,0000,0000,0000},
        {534, 1185,1180,1179,1178,1127,1126,1125,1124,1123,1122,1106,1101,1100,0000,0000,0000,0000,0000},
        {535, 1121,1120,1119,1118,1117,1116,1115,1114,1113,1110,1109,0000,0000,0000,0000,0000,0000,0000},
        {536, 1184,1183,1182,1181,1128,1108,1107,1105,1104,1103,0000,0000,0000,0000,0000,0000,0000,0000},
        {540, 1145,1144,1143,1142,1024,1023,1020,1019,1018,1017,1007,1006,1004,1001,0000,0000,0000,0000},
        {542, 1145,1144,1021,1020,1019,1018,1015,1014,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {546, 1145,1144,1143,1142,1024,1023,1019,1018,1017,1007,1006,1004,1002,1001,0000,0000,0000,0000},
        {547, 1143,1142,1021,1020,1019,1018,1016,1003,1000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {549, 1145,1144,1143,1142,1023,1020,1019,1018,1017,1012,1011,1007,1003,1001,0000,0000,0000,0000},
        {550, 1145,1144,1143,1142,1023,1020,1019,1018,1006,1005,1004,1003,1001,0000,0000,0000,0000,0000},
        {551, 1023,1021,1020,1019,1018,1016,1006,1005,1003,1002,0000,0000,0000,0000,0000,0000,0000,0000},
        {558, 1168,1167,1166,1165,1164,1163,1095,1094,1093,1092,1091,1090,1089,1088,0000,0000,0000,0000},
        {559, 1173,1162,1161,1160,1159,1158,1072,1071,1070,1069,1068,1067,1066,1065,0000,0000,0000,0000},
        {560, 1170,1169,1141,1140,1139,1138,1033,1032,1031,1030,1029,1028,1027,1026,0000,0000,0000,0000},
        {561, 1157,1156,1155,1154,1064,1063,1062,1061,1060,1059,1058,1057,1056,1055,1031,1030,1027,1026},
        {562, 1172,1171,1149,1148,1147,1146,1041,1040,1039,1038,1037,1036,1035,1034,0000,0000,0000,0000},
        {565, 1153,1152,1151,1150,1054,1053,1052,1051,1050,1049,1048,1047,1046,1045,0000,0000,0000,0000},
        {567, 1189,1188,1187,1186,1133,1132,1131,1130,1129,1102,0000,0000,0000,0000,0000,0000,0000,0000},
        {575, 1177,1176,1175,1174,1099,1044,1043,1042,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {576, 1193,1192,1191,1190,1137,1136,1135,1134,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {580, 1023,1020,1018,1017,1007,1006,1001,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {589, 1145,1144,1024,1020,1018,1017,1016,1013,1007,1006,1005,1004,1000,0000,0000,0000,0000,0000},
        {600, 1022,1020,1018,1017,1013,1007,1006,1005,1004,0000,0000,0000,0000,0000,0000,0000,0000,0000},
        {603, 1145,1144,1143,1142,1024,1023,1020,1019,1018,1017,1007,1006,1001,0000,0000,0000,0000,0000}
    };

iswheelmodel(modelid) {
   
    new wheelmodels[17] = {1025,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1096,1097,1098};
   
    foreach(wheelmodels, I) {
       
        if (modelid == wheelmodels[I])
            return true;
       
    }
   
    return false;
}

IllegalCarNitroIde(carmodel) {
   
    new illegalvehs[29] = { 581, 523, 462, 521, 463, 522, 461, 448, 468, 586, 509, 481, 510, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 590, 569, 537, 538, 570, 449 };
   
    foreach(illegalvehs, I) {
       
        if (carmodel == illegalvehs[I])
            return true;
       
    }
   
    return false;
}

// assumes player is in a car - make sure it is.
illegal_nos_vehicle(PlayerID) {
   
    new carid = GetPlayerVehicleID(PlayerID);
    new playercarmodel = GetVehicleModel(carid);
   
    return IllegalCarNitroIde(playercarmodel);
   
}

stock islegalcarmod(vehicleide, componentid) {
   
    new modok = false;
   
    // stereo, hydraulics & nos (1x 2x 3x) are special.
    if ( (iswheelmodel(componentid)) || (componentid == 1086) || (componentid == 1087) || ((componentid >= 1008) && (componentid <= 1010))) {
       
        new nosblocker = IllegalCarNitroIde(vehicleide);
       
        if (!nosblocker)
            modok = true;
       
    } else {
       
        // check if the specified model CAN use this particular mod.
        foreach(legalmods, I) {
           
            if (legalmods[I][0] == vehicleide) { // first is car IDE
               
                for(new J = 1; J < 22; J++) { // start with 1
                    if (legalmods[I][J] == componentid)
                        modok = true;
                }
               
            }
           
        }
       
    }
   
    return modok;
}

OnVehicleMod(playerid, vehicleid, componentid) {
   
    new vehicleide = GetVehicleModel(vehicleid);
    new modok = islegalcarmod(vehicleide, componentid);
   
    if (!modok) {
        AddEchoMessageEx("[invalid_mod] %s %d %d %d %d %d", pNickname[playerid], playerid, vehicleid, vehicleide, componentid);
        banaplayer(ANTICHEAT_ID, PlayerID, "Fuck you and your mods!");
        return 0;
    }
   
    return 1;
}
This should be 99% self-explanatory, this is a table of legal mods per vehicle & a way to block all invalid (crashy) mods from being applied.

There are assholes running bots which connect to a server, teleport in a car around and send crashing mod info to crash players en-masse, this should enable you to 100% protect yourself against this threat.

I just took this out of my gamemode quickly so it's not a filterscript, but the first person to release a filterscript = gratuitous turtle reward?
Reply
#2

Awesome.
Reply
#3

Perfect, thank you.
Reply
#4

Great Thanks for this
Reply
#5

Nice.
Reply
#6

It's nice. Even though I wouldn't call this a tutorial since it's just a snippet of code.
Reply
#7

Thanks for the tips.
Reply
#8

Quote:

banaplayer(ANTICHEAT_ID, PlayerID, "Fuck you and your mods!");


Nice job
Reply
#9

lol @ .."Fuck you and your mods!");
Reply
#10

Thanks but where do I put all that data, I want to say under which heading?
Reply
#11

wow,you're bored
anyway nice & thanks.
Question: Y there's so much ' 0 ' (zero's) in it?
Reply
#12

Hi, I released a FS in PT-BR Board.
Check:

http://forum.sa-mp.com/showthread.ph...17#post1688417

Thanks for sharing that!
Reply
#13

nice
Reply
#14

What the hell would cause these? I implented this in my script and these occured, I've been puzzling around it for a while but the problem is I don't know what causes this:

Код:
error 017: undefined symbol "wheelmodels@YSII_Ag"
error 017: undefined symbol "wheelmodels@YSII_Ag"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Bolden line causes the error:
Код:
iswheelmodel(modelid) {

    new wheelmodels[17] = {1025,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1096,1097,1098};

    foreach(wheelmodels, I) {

        if (modelid == wheelmodels[I])
            return true;

    }

    return false;
}
Reply
#15

Quote:
Originally Posted by Coffeemonster
Посмотреть сообщение
foreach(wheelmodels, I)
Oh, replace with a ordinary loop or:

Код:
#define foreach(%1,%2) for (new %2 = 0; %2 < sizeof(%1); %2++ )
Reply
#16

How to fix this?
pawn Код:
D:\2231\lronboy\My Documents\Downloads\New Folder\gamemodes\GTDM2.pwn(28876) : error 017: undefined symbol "YSI_gSwheelmodels"
D:\2231\lronboy\My Documents\Downloads\New Folder\gamemodes\GTDM2.pwn(28876) : error 017: undefined symbol "YSI_gAwheelmodels"
D:\2231\lronboy\My Documents\Downloads\New Folder\gamemodes\GTDM2.pwn(28876) : warning 215: expression has no effect
D:\2231\lronboy\My Documents\Downloads\New Folder\gamemodes\GTDM2.pwn(28876) : error 001: expected token: ";", but found "]"
D:\2231\lronboy\My Documents\Downloads\New Folder\gamemodes\GTDM2.pwn(28876) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#17

http://forum.sa-mp.com/showthread.ph...05#post1702805

I compiled it to a filterscript :3
Reply
#18

Unless I am blind you have too many %d
AddEchoMessageEx("[invalid_mod] %s %d %d %d %d %d", pNickname[playerid], playerid, vehicleid, vehicleide, componentid);

Reply
#19

Great code, thanks.
I downloaded it, and made big performance optimizations on it, so it will eat less CPU. I will autoban those bastards who provoke these crashes. I will also profit from it to also autoban all those who just mod their car anywhere else than in the modshop.
Reply
#20

Quote:

I downloaded it, and made big performance optimizations on it, so it will eat less CPU.

Mind elaborating? Also, sharing is caring.

Edit: Here's my shot at optimizing the function a little bit..

pawn Code:
stock IsVehicleComponentLegal(vehicleid, componentid) {
    new s_LegalMods[][] = {
        {54273792, 0, 16776704, 7, 0, 0},
        {35268602, 0, 16776704, 7, 245760, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {37431173, 0, 16776704, 7, 0, 0},
        {45893379, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {62531466, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {42862474, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {36767556, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {36177722, 0, 16776704, 7, 0, 0},
        {45958913, 0, 16776704, 7, 0, 0},
        {37365632, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {36177786, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {41560010, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {42084234, 0, 16776704, 7, 245760, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {37619648, 0, 16776704, 7, 0, 0},
        {57685808, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {52242293, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {46024584, 0, 16776704, 7, 245760, 0},
        {33621873, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {43651022, 0, 16776704, 7, 49152, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {54011648, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {37717909, 0, 16776704, 7, 0, 0},
        {43976588, 0, 16776704, 7, 245760, 0},
        {43395050, 0, 16776704, 7, 245760, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {37144450, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {43917258, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, -67107785, 0, 35389440},
        {33556224, 0, 16776704, 67002375, 0, 0},
        {33556224, 0, 16776704, 7047, 1, 31457280},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {60688338, 0, 16776704, 7, 245760, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {37537536, 0, 16776704, 7, 196608, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {59639766, 0, 16776704, 7, 245760, 0},
        {37553929, 0, 16776704, 7, 49152, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {43917194, 0, 16776704, 7, 245760, 0},
        {43779962, 0, 16776704, 7, 245760, 0},
        {45942636, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, -512, 7, 0, 504},
        {33556224, 0, 16777214, 7, -1073741824, 8199},
        {-33552640, 3, 16776704, 7, 15360, 1536},
        {-838859008, -8388608, 16776705, 7, 1006632960, 0},
        {33556224, 1020, 16776704, 7, 3932160, 6144},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 8380416, 16776704, 7, 62914560, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 71, 62, 1006632960},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 7168, 16776704, 15, 0, 245760},
        {33556224, 0, 16776704, 7, 960, -1073741824},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {43386818, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {51849201, 0, 16776704, 7, 196608, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {39200752, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {60688322, 0, 16776704, 7, 245760, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0},
        {33556224, 0, 16776704, 7, 0, 0}
    };
   
    // These is the only case with componentids > 1191 (saves ~1kb in the array)
    if (vehicleid == 576 && (componentid == 1192 || componentid == 1193))
        return true;
   
    if (1000 <= componentid <= 1191 && 400 <= vehicleid <= 611) {
        componentid -= 1000;
        vehicleid -= 400;
       
        return (s_LegalMods[vehicleid][componentid >>> 5] & 1 << (componentid & 31)) || false;
    }
   
    return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)