SA-MP Forums Archive
[Include] [Stock] GetComponentName and ModFitsForCar - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [Stock] GetComponentName and ModFitsForCar (/showthread.php?tid=282514)



[Stock] GetComponentName and ModFitsForCar - Kyle_Olsen - 11.09.2011

I had a pain in the ass hour of adding all of the 194 names of vehicle components.

I decided to release the stock function I made, because I seriously don't want anyone to have to do this again.

It works as simply as

GetComponentName
Parameters:
pawn Код:
(component)
component ID - The ID of the component (Can be found here

returns A string which contains the name of the component.

Here's the code:

pawn Код:
stock GetComponentName(component)
{
    new modname[50];
    switch(component)
    {
       case 1000: format(modname, sizeof(modname), "Pro Spoiler");
       case 1001: format(modname, sizeof(modname), "Win Spoiler");
       case 1002: format(modname, sizeof(modname), "Drag Spoiler");
       case 1003: format(modname, sizeof(modname), "Alpha Spoiler");
       case 1004: format(modname, sizeof(modname), "Champ Scoop");
       case 1005: format(modname, sizeof(modname), "Fury Scoop");
       case 1006: format(modname, sizeof(modname), "Roof Scoop");
       case 1007: format(modname, sizeof(modname), "Right Sideskirt");
       case 1008: format(modname, sizeof(modname), "Nitrous x5");
       case 1009: format(modname, sizeof(modname), "Nitrous x2");
       case 1010: format(modname, sizeof(modname), "Nitrous x10");
       case 1011: format(modname, sizeof(modname), "Race Scoop");
       case 1012: format(modname, sizeof(modname), "Worx Scoop");
       case 1013: format(modname, sizeof(modname), "Round Fog Lights");
       case 1014: format(modname, sizeof(modname), "Champ Spoiler");
       case 1015: format(modname, sizeof(modname), "Race Spoiler");
       case 1016: format(modname, sizeof(modname), "Worx Spoiler");
       case 1017: format(modname, sizeof(modname), "Left Sideskirt");
       case 1018: format(modname, sizeof(modname), "Upswept Exhaust");
       case 1019: format(modname, sizeof(modname), "Twin Exhaust");
       case 1020: format(modname, sizeof(modname), "Large Exhaust");
       case 1021: format(modname, sizeof(modname), "Medium Exhaust");
       case 1022: format(modname, sizeof(modname), "Small Exhaust");
       case 1023: format(modname, sizeof(modname), "Fury Spoiler");
       case 1024: format(modname, sizeof(modname), "Square Fog Lights");
       case 1025: format(modname, sizeof(modname), "Offroad Wheels");
       case 1026, 1036, 1047, 1056, 1069, 1090: format(modname, sizeof(modname), "Right Alien Sideskirt");
       case 1027, 1040, 1051, 1062, 1071, 1094: format(modname, sizeof(modname), "Left Alien Sideskirt");
       case 1028, 1034, 1046, 1064, 1065, 1092: format(modname, sizeof(modname), "Alien Exhaust");
       case 1029, 1037, 1045, 1059, 1066, 1089: format(modname, sizeof(modname), "X-Flow Exhaust");
       case 1030, 1039, 1048, 1057, 1070, 1095: format(modname, sizeof(modname), "Right X-Flow Sideskirt");
       case 1031, 1041, 1052, 1063, 1072, 1093: format(modname, sizeof(modname), "Left X-Flow Sideskirt");
       case 1032, 1038, 1054, 1055, 1067, 1088: format(modname, sizeof(modname), "Alien Roof Vent");
       case 1033, 1035, 1053, 1061, 1068, 1091: format(modname, sizeof(modname), "X-Flow Roof Vent");
       case 1042: format(modname, sizeof(modname), "Right Chrome Sideskirt");
       case 1099: format(modname, sizeof(modname), "Left Chrome Sideskirt");
       case 1043, 1105, 1114, 1127, 1132, 1135: format(modname, sizeof(modname), "Slamin Exhaust");
       case 1044, 1104, 1113, 1126, 1129, 1136: format(modname, sizeof(modname), "Chrome Exhaust");
       case 1050, 1058, 1139, 1146, 1158, 1163: format(modname, sizeof(modname), "X-Flow Spoiler");
       case 1049, 1060, 1138, 1147, 1162, 1164: format(modname, sizeof(modname), "Alien Spoiler");
       case 1073: format(modname, sizeof(modname), "Shadow Wheels");
       case 1074: format(modname, sizeof(modname), "Mega Wheels");
       case 1075: format(modname, sizeof(modname), "Rimshine Wheels");
       case 1076: format(modname, sizeof(modname), "Wires Wheels");
       case 1077: format(modname, sizeof(modname), "Classic Wheels");
       case 1078: format(modname, sizeof(modname), "Twist Wheels");
       case 1079: format(modname, sizeof(modname), "Cutter Wheels");
       case 1080: format(modname, sizeof(modname), "Stitch Wheels");
       case 1081: format(modname, sizeof(modname), "Grove Wheels");
       case 1082: format(modname, sizeof(modname), "Import Wheels");
       case 1083: format(modname, sizeof(modname), "Dollar Wheels");
       case 1084: format(modname, sizeof(modname), "Trance Wheels");
       case 1085: format(modname, sizeof(modname), "Atomic Wheels");
       case 1086: format(modname, sizeof(modname), "Stereo");
       case 1087: format(modname, sizeof(modname), "Hydraulics");
       case 1096: format(modname, sizeof(modname), "Ahab Wheels");
       case 1097: format(modname, sizeof(modname), "Virtual Wheels");
       case 1098: format(modname, sizeof(modname), "Access Wheels");
       case 1100: format(modname, sizeof(modname), "Chrome Grill");
       case 1101: format(modname, sizeof(modname), "Left Chrome Flames Sideskirt");
       case 1102, 1107: format(modname, sizeof(modname), "Left Chrome Strip Sideskirt");
       case 1103: format(modname, sizeof(modname), "Convertible Roof");
       case 1106, 1124: format(modname, sizeof(modname), "Left Chrome Arches Sideskirt");
       case 1108, 1133, 1134: format(modname, sizeof(modname), "Right Chrome Strip Sideskirt");
       case 1109: format(modname, sizeof(modname), "Chrome Rear Bullbars");
       case 1110: format(modname, sizeof(modname), "Slamin Rear Bullbars");
       case 1111, 1112: format(modname, sizeof(modname), "Front Sign");
       case 1115: format(modname, sizeof(modname), "Chrome Front Bullbars");
       case 1116: format(modname, sizeof(modname), "Slamin Front Bullbars");
       case 1117, 1174, 1179, 1182, 1189, 1191: format(modname, sizeof(modname), "Chrome Front Bumper");
       case 1175, 1181, 1185, 1188, 1190: format(modname, sizeof(modname), "Slamin Front Bumper");
       case 1176, 1180, 1184, 1187, 1192: format(modname, sizeof(modname), "Chrome Rear Bumper");
       case 1177, 1178, 1183, 1186, 1193: format(modname, sizeof(modname), "Slamin Rear Bumper");
       case 1118: format(modname, sizeof(modname), "Right Chrome Trim Sideskirt");
       case 1119: format(modname, sizeof(modname), "Right Wheelcovers Sideskirt");
       case 1120: format(modname, sizeof(modname), "Left Chrome Trim Sideskirt");
       case 1121: format(modname, sizeof(modname), "Left Wheelcovers Sideskirt");
       case 1122: format(modname, sizeof(modname), "Right Chrome Flames Sideskirt");
       case 1123: format(modname, sizeof(modname), "Bullbar Chrome Bars");
       case 1125: format(modname, sizeof(modname), "Bullbar Chrome Lights");
       case 1128: format(modname, sizeof(modname), "Vinyl Hardtop Roof");
       case 1130: format(modname, sizeof(modname), "Hardtop Roof");
       case 1131: format(modname, sizeof(modname), "Softtop Roof");
       case 1140, 1148, 1151, 1156, 1161, 1167: format(modname, sizeof(modname), "X-Flow Rear Bumper");
       case 1141, 1149, 1150, 1154, 1159, 1168: format(modname, sizeof(modname), "Alien Rear Bumper");
       case 1142: format(modname, sizeof(modname), "Left Oval Vents");
       case 1143: format(modname, sizeof(modname), "Right Oval Vents");
       case 1144: format(modname, sizeof(modname), "Left Square Vents");
       case 1145: format(modname, sizeof(modname), "Right Square Vents");
       case 1152, 1157, 1165, 1170, 1172, 1173: format(modname, sizeof(modname), "X-Flow Front Bumper");
       case 1153, 1155, 1160, 1166, 1169, 1171: format(modname, sizeof(modname), "Alien Front Bumper");
       
    }
    return modname;
}

Added, here is the ModFitsForCar.

ModFitsForCar

Parameters:
pawn Код:
(model, component)
model - The vehicle model ID
component - The component ID

Returns - 1 If it fits for the vehicle, 0 if it doesn't

Here's the code:
pawn Код:
stock ModFitsForCar(model, component)
{
   new thing = 0;
   if(model == 560 || model == 562 || model == 575 || model == 565 || model == 561 || model == 559 || model == 558 || model == 534 || model == 567 || model == 536 || model == 535 || model == 576)
   {
      switch(component)
      {
         case 1000: thing = 1;
         case 1001: thing = 1;
         case 1002: thing = 1;
         case 1003: thing = 1;
         case 1004: thing = 1;
         case 1005: thing = 1;
         case 1006: thing = 1;
         case 1007: thing = 1;
         case 1011: thing = 1;
         case 1012: thing = 1;
         case 1013: thing = 1;
         case 1014: thing = 1;
         case 1015: thing = 1;
         case 1016: thing = 1;
         case 1017: thing = 1;
         case 1023: thing = 1;
         case 1024: thing = 1;
         case 1025: thing = 1;
         case 1142: thing = 1;
         case 1143: thing = 1;
         case 1144: thing = 1;
         case 1145: thing = 1;
      }
      switch(model)
      {
          case 560:
          {
              switch(component)
              {
                  case 1026: thing = 1;
                  case 1027: thing = 1;
                  case 1028: thing = 1;
                  case 1029: thing = 1;
                  case 1030: thing = 1;
                  case 1031: thing = 1;
                  case 1032: thing = 1;
                  case 1033: thing = 1;
                  case 1138: thing = 1;
                  case 1139: thing = 1;
                  case 1140: thing = 1;
                  case 1141: thing = 1;
                  case 1169: thing = 1;
                  case 1170: thing = 1;
              }
          }
          case 562:
          {
              switch(component)
              {
                  case 1034: thing = 1;
                  case 1035: thing = 1;
                  case 1036: thing = 1;
                  case 1037: thing = 1;
                  case 1038: thing = 1;
                  case 1039: thing = 1;
                  case 1040: thing = 1;
                  case 1041: thing = 1;
                  case 1146: thing = 1;
                  case 1147: thing = 1;
                  case 1148: thing = 1;
                  case 1149: thing = 1;
                  case 1171: thing = 1;
                  case 1172: thing = 1;
              }
          }
          case 575:
          {
              switch(component)
              {
                  case 1042: thing = 1;
                  case 1043: thing = 1;
                  case 1044: thing = 1;
                  case 1099: thing = 1;
                  case 1174: thing = 1;
                  case 1175: thing = 1;
                  case 1176: thing = 1;
                  case 1177: thing = 1;
              }
          }
          case 565:
          {
              switch(component)
              {
                  case 1045: thing = 1;
                  case 1046: thing = 1;
                  case 1047: thing = 1;
                  case 1048: thing = 1;
                  case 1049: thing = 1;
                  case 1050: thing = 1;
                  case 1051: thing = 1;
                  case 1052: thing = 1;
                  case 1053: thing = 1;
                  case 1054: thing = 1;
                  case 1150: thing = 1;
                  case 1151: thing = 1;
                  case 1152: thing = 1;
                  case 1153: thing = 1;
              }
          }
          case 561:
          {
              switch(component)
              {
                  case 1055: thing = 1;
                  case 1056: thing = 1;
                  case 1057: thing = 1;
                  case 1058: thing = 1;
                  case 1059: thing = 1;
                  case 1060: thing = 1;
                  case 1061: thing = 1;
                  case 1062: thing = 1;
                  case 1063: thing = 1;
                  case 1064: thing = 1;
                  case 1154: thing = 1;
                  case 1155: thing = 1;
                  case 1156: thing = 1;
                  case 1157: thing = 1;
              }
          }
          case 559:
          {
              switch(component)
              {
                  case 1065: thing = 1;
                  case 1066: thing = 1;
                  case 1067: thing = 1;
                  case 1068: thing = 1;
                  case 1069: thing = 1;
                  case 1070: thing = 1;
                  case 1071: thing = 1;
                  case 1072: thing = 1;
                  case 1158: thing = 1;
                  case 1159: thing = 1;
                  case 1160: thing = 1;
                  case 1161: thing = 1;
                  case 1162: thing = 1;
                  case 1173: thing = 1;
              }
          }
          case 558:
          {
              switch(component)
              {
                  case 1088: thing = 1;
                  case 1089: thing = 1;
                  case 1090: thing = 1;
                  case 1091: thing = 1;
                  case 1092: thing = 1;
                  case 1093: thing = 1;
                  case 1094: thing = 1;
                  case 1095: thing = 1;
                  case 1163: thing = 1;
                  case 1164: thing = 1;
                  case 1165: thing = 1;
                  case 1166: thing = 1;
                  case 1167: thing = 1;
                  case 1168: thing = 1;
              }
          }
          case 534:
          {
              switch(component)
              {
                  case 1100: thing = 1;
                  case 1101: thing = 1;
                  case 1122: thing = 1;
                  case 1123: thing = 1;
                  case 1124: thing = 1;
                  case 1125: thing = 1;
                  case 1126: thing = 1;
                  case 1127: thing = 1;
                  case 1178: thing = 1;
                  case 1179: thing = 1;
                  case 1180: thing = 1;
                  case 1185: thing = 1;
              }
          }
          case 567:
          {
              switch(component)
              {
                  case 1129: thing = 1;
                  case 1130: thing = 1;
                  case 1131: thing = 1;
                  case 1132: thing = 1;
                  case 1133: thing = 1;
                  case 1186: thing = 1;
                  case 1187: thing = 1;
                  case 1188: thing = 1;
                  case 1189: thing = 1;
              }
          }
          case 536:
          {
              switch(component)
              {
                  case 1103: thing = 1;
                  case 1104: thing = 1;
                  case 1105: thing = 1;
                  case 1107: thing = 1;
                  case 1108: thing = 1;
                  case 1128: thing = 1;
                  case 1181: thing = 1;
                  case 1182: thing = 1;
                  case 1183: thing = 1;
                  case 1184: thing = 1;
              }
          }
          case 535:
          {
              switch(component)
              {
                  case 1110: thing = 1;
                  case 1111: thing = 1;
                  case 1112: thing = 1;
                  case 1113: thing = 1;
                  case 1114: thing = 1;
                  case 1115: thing = 1;
                  case 1116: thing = 1;
                  case 1117: thing = 1;
                  case 1118: thing = 1;
                  case 1119: thing = 1;
                  case 1120: thing = 1;
                  case 1121: thing = 1;
              }
          }
          case 576:
          {
              switch(component)
              {
                  case 1134: thing = 1;
                  case 1135: thing = 1;
                  case 1136: thing = 1;
                  case 1137: thing = 1;
                  case 1190: thing = 1;
                  case 1191: thing = 1;
                  case 1192: thing = 1;
                  case 1193: thing = 1;
              }
          }
      }
   }
   switch(component)
   {
       case 1008: thing = 1;
       case 1009: thing = 1;
       case 1010: thing = 1;
       case 1018: thing = 1;
       case 1019: thing = 1;
       case 1020: thing = 1;
       case 1021: thing = 1;
       case 1022: thing = 1;
       case 1073: thing = 1;
       case 1074: thing = 1;
       case 1075: thing = 1;
       case 1076: thing = 1;
       case 1077: thing = 1;
       case 1078: thing = 1;
       case 1079: thing = 1;
       case 1080: thing = 1;
       case 1081: thing = 1;
       case 1082: thing = 1;
       case 1083: thing = 1;
       case 1084: thing = 1;
       case 1085: thing = 1;
       case 1086: thing = 1;
       case 1087: thing = 1;
       case 1096: thing = 1;
       case 1097: thing = 1;
       case 1098: thing = 1;
       
   }
   return thing;
}
I hope you'll appriciate it.


Re: [Stock] GetComponentName and ModFitsForCar - FireCat - 11.09.2011

Nice ;b


Re: [Stock] GetComponentName and ModFitsForCar - Kyle - 11.09.2011

Nice release, well done.


Re: [Stock] GetComponentName and ModFitsForCar - steki. - 11.09.2011

return?


Re: [Stock] GetComponentName and ModFitsForCar - sk47 - 11.09.2011

pawn Код:
case 1000: modname = "Pro Spoiler";
case 1001: modname = "Win Spoiler";
...
pawn Код:
case 1000..1007: thing = 1;
case 1011..1017: thing = 1;
case 1023..1025: thing = 1;
case 1142..1145: thing = 1;



Re: [Stock] GetComponentName and ModFitsForCar - BigETI - 11.09.2011

More simplified for GetComponentName:
pawn Код:
new ModName[][64] = {
{"Pro Spoiler"},                                    //1000
{"Win Spoiler"},                                    //1001
{"Drag Spoiler"},                                   //1002
{"Alpha Spoiler"},                                  //1003
{"Champ Scoop Hood"},                               //1004
{"Fury Scoop Hood"},                                //1005
{"Roof Scoop"},                                     //1006
{"Right Sideskirt"},                                //1007
{"5x Nitro"},                                       //1008
{"2x Nitro"},                                       //1009
{"10x Nitro"},                                      //1010
{"Race Scoop Hood"},                                //1011
{"Worx Scoop Hood"},                                //1012
{"Round Fog Lamps"},                                //1013
{"Champ Spoiler"},                                  //1014
{"Race Spoiler"},                                   //1015
{"Worx Spoiler"},                                   //1016
{"Left Sideskirt"},                                 //1017
{"Upswept Exhaust"},                                //1018
{"Twin Exhaust"},                                   //1019
{"Large Exhaust"},                                  //1020
{"Medium Exhaust"},                                 //1021
{"Small Exhaust"},                                  //1022
{"Fury Spoiler"},                                   //1023
{"Square Fog Lamps"},                               //1024
{"Offroad Wheels"},                                 //1025
{"Right Alien Sideskirt 'Sultan'"},                 //1026
{"Left Alien Sideskirt 'Sultan'"},                  //1027
{"Alien Exhaust 'Sultan'"},                         //1028
{"X-Flow Exhaust 'Sultan'"},                        //1029
{"Left X-Flow Sideskirt 'Sultan'"},                 //1030
{"Right X-Flow Sideskirt 'Sultan'"},                //1031
{"Alien Roof Vent 'Sultan'"},                       //1032
{"X-Flow Roof Vent 'Sultan'"},                      //1033
{"Alien Exhaust 'Elegy'"},                          //1034
{"X-Flow Roof Vent 'Elegy'"},                       //1035
{"Right Alien Sideskirt 'Elegy'"},                  //1036
{"X-Flow Exhaust 'Elegy'"},                         //1037
{"Alien Roof Vent 'Elegy'"},                        //1038
{"Right X-Flow Sideskirt 'Elegy'"},                 //1039
{"Left Alien Sideskirt 'Elegy'"},                   //1040
{"Right X-Flow Sideskirt 'Elegy'"},                 //1041
{"Right Chrome Sideskirt 'Broadway'"},              //1042
{"Slamin Exhaust 'Broadway'"},                      //1043
{"Chrome Exhaust 'Broadway'"},                      //1044
{"X-Flow Exhaust 'Flash'"},                         //1045
{"Alien Exhaust 'Flash'"},                          //1046
{"Right Alien Sideskirt 'Flash'"},                  //1047
{"Right X-Flow Sideskirt 'Flash'"},                 //1048
{"Alien Spoiler 'Flash'"},                          //1049
{"X-Flow Spoiler 'Flash'"},                         //1050
{"Left Alien Sideskirt 'Flash'"},                   //1051
{"Left X-Flow Sideskirt 'Flash'"},                  //1052
{"X-Flow Roof 'Flash'"},                            //1053
{"Alien Roof 'Flash'"},                             //1054
{"Alien Roof 'Stratum'"},                           //1055
{"Right Alien Sideskirt 'Stratum'"},                //1056
{"Right X-Flow Sideskirt 'Stratum'"},               //1057
{"Alien Spoiler 'Stratum'"},                        //1058
{"X-Flow Exhaust 'Stratum'"},                       //1059
{"X-Flow Spoiler 'Stratum'"},                       //1060
{"X-Flow Roof 'Stratum'"},                          //1061
{"Left Alien Sideskirt 'Stratum'"},                 //1062
{"Left X-Flow Sideskirt 'Stratum'"},                //1063
{"Alien Exhaust 'Stratum'"},                        //1064
{"Alien Exhaust 'Jester'"},
{"X-Flow Exhaust 'Jester'"},
{"Alien Roof 'Jester'"},
{"X-Flow Roof 'Jester'"},
{"Right Alien Sideskirt 'Jester'"},
{"Right X-Flow Sideskirt 'Jester'"},                //1070
{"Left Alien Sideskirt 'Jester'"},
{"Left X-Flow Sideskirt 'Jester'"},
{"Shadow Wheels"},
{"Mega Wheels"},
{"Rimshine Wheels"},
{"Wires Wheels"},
{"Classic Wheels"},
{"Twist Wheels"},
{"Cutter Wheels"},
{"Switch Wheels"},                                  //1080
{"Grove Wheels"},
{"Import Wheels"},
{"Dollar Wheels"},
{"Trance Wheels"},
{"Atomic Wheels"},
{"Stereo Sound"},
{"Hydraulics"},
{"Alien Roof 'Uranus'"},
{"X-Flow Exhaust 'Uranus'"},
{"Right Alien Sideskirt 'Uranus'"},                 //1090
{"X-Flow Roof 'Uranus'"},
{"Alien Exhaust 'Uranus'"},
{"Right X-Flow Sideskirt 'Uranus'"},
{"Left Alien Sideskirt 'Uranus'"},
{"Right X-Flow Sideskirt 'Uranus'"},
{"Ahab Wheels"},
{"Virtual Wheels"},
{"Access Wheels"},
{"Left Chrome Sideskirt 'Broadway'"},
{"Chrome Grill Bullbar 'Remington'"},               //1100
{"Left 'Chrome Flames' Sideskirt 'Remington'"},
{"Left 'Chrome Strip' Sideskirt 'Savanna'"},
{"Corvetible Roof 'Blade'"},
{"Chrome Exhaust 'Blade'"},
{"Slamin Exhaust 'Blade'"},
{"Right 'Chrome Arches' Sideskirt 'Remington'"},
{"Left 'Chrome Strip' Sideskirt 'Blade'"},
{"Right 'Chrome Strip' Sideskirt 'Blade'"},
{"Chrome Rear Bullbars 'Slamvan'"},
{"Slamin Rear Bullbars 'Slamvan'"},                 //1110
{"Little Front Sign? 'Slamvan'"},
{"Little Front Sign? 'Slamvan'"},
{"Chrome Exhaust 'Slamvan'"},
{"Slamin Exhaust 'Slamvan'"},
{"Chrome Front Bullbars 'Slamvan'"},
{"Slamin Front Bullbars 'Slamvan'"},
{"Chrome Front Bumper 'Slamvan'"},
{"Right 'Chrome Trim' Sideskirt 'Slamvan'"},
{"Right 'Wheelcovers' Sideskirt 'Slamvan'"},
{"Left 'Chrome Trim' Sideskirt 'Slamvan'"},         //1120
{"Left 'Wheelcovers' Sideskirt 'Slamvan'"},
{"Right 'Chrome Flames' Sideskirt 'Remington'"},
{"Bullbar Chrome Bars 'Remington'"},
{"Left 'Chrome Arches' Sideskirt 'Remington'"},
{"Bullbar Chrome Lights 'Remongton'"},
{"Chrome Exhaust 'Remington'"},
{"Slamin Exhaust 'Remington'"},
{"Vinyl Hardtop 'Blade'"},
{"Chrome Exhaust 'Savanna'"},
{"Hardtop Roof 'Savanna'"},                         //1130
{"Softtop Roof 'Savanna'"},
{"Slamin Exhaust 'Savanna'"},
{"Right 'Chrome Strip' Sideskirt 'Savanna'"},
{"Right 'Chrome Strip' Sideskirt 'Tornado'"},
{"Slamin Exhaust 'Tornado'"},
{"Chrome Exhaust 'Tornado'"},
{"Left 'Chrome Strip' Sideskirt 'Tornado'"},
{"Alien Spoiler 'Sultan'"},
{"X-Flow Spoiler 'Sultan'"},
{"X-Flow Rear Bumper 'Sultan'"},                    //1140
{"Alien Rear Bumper 'Sultan'"},
{"Left Oval Vents"},
{"Right Oval Vents"},
{"Left Square Vents"},
{"Right Square Vents"},
{"X-Flow Spoiler 'Elegy'"},
{"Alien Spoiler 'Elegy'"},
{"X-Flow Rear Bumper 'Elegy'"},
{"Alien Rear Bumper 'Elegy'"},
{"Alien Rear Bumper 'Flash'"},                      //1150
{"X-Flow Rear Bumper 'Flash'"},
{"X-Flow Front Bumper 'Flash'"},
{"Alien Front Bumper 'Flash'"},
{"Alien Rear Bumper 'Stratum'"},
{"Alien Front Bumper 'Stratum'"},
{"X-Flow Rear Bumper 'Stratum'"},
{"X-Flow Front Bumper 'Stratum'"},
{"X-Flow Spoiler 'Jester'"},
{"Alien Rear Bumper 'Jester'"},
{"Alien Front Bumper 'Jester'"},                    //1160
{"X-Flow Rear Bumper 'Jester'"},
{"Alien Spoiler 'Jester'"},
{"X-Flow Spoiler 'Uranus'"},
{"Alien Spoiler 'Uranus'"},
{"X-Flow Front Bumper 'Uranus'"},
{"Alien Front Bumper 'Uranus'"},
{"X-Flow Rear Bumper 'Uranus'"},
{"Alien Rear Bumper 'Uranus'"},
{"Alien Front Bumper 'Sultan'"},
{"X-Flow Front Bumper 'Sultan'"},                   //1170
{"Alien Front Bumper 'Elegy'"},
{"X-Flow Front Bumper 'Elegy'"},
{"X-Flow Front Bumper 'Jester'"},
{"Chrome Front Bumper 'Broadway'"},
{"Slamin Front Bumper 'Broadway'"},
{"Chrome Rear Bumper 'Broadway'"},
{"Slamin Rear Bumper 'Broadway'"},
{"Slamin Rear Bumper 'Remington'"},
{"Chrome Front Bumper 'Remington'"},
{"Chrome Rear Bumper 'Remington'"},                 //1180
{"Slamin Front Bumper 'Blade'"},
{"Chrome Front Bumper 'Blade'"},
{"Slamin Rear Bumper 'Blade'"},
{"Chrome Rear Bumper 'Blade'"},
{"Slamin Front Bumper 'Remington'"},
{"Slamin Rear Bumper 'Savanna'"},
{"Chrome Rear Bumper 'Savanna'"},
{"Slamin Front Bumper 'Savanna'"},
{"Chrome Front Bumper 'Savanna'"},
{"Slamin Front Bumper 'Tornado'"},                  //1190
{"Chrome Front Bumper 'Tornado'"},
{"Chrome Rear Bumper 'Tornado'"},
{"Slamin Rear Bumper 'Tornado'"}
};

stock GetComponentName(component) return ModName[component-1000]; //This one just uses 1 line at the end :D
And please use booleans if you want to get yes/false stats
pawn Код:
new bool:thing;
//...
thing = true;
//...
return thing;



Re: [Stock] GetComponentName and ModFitsForCar - Kyle_Olsen - 11.09.2011

The first thing have I experienced to be buggy and stuff, so I decided to go with format instead.

The second thing, I didn't really think over that they were just after each other.


Re: [Stock] GetComponentName and ModFitsForCar - ugledalen - 15.09.2011

Nice work


Re: [Stock] GetComponentName and ModFitsForCar - CJsMom - 11.07.2014

cool


Re: [Stock] GetComponentName and ModFitsForCar - NewerthRoleplay - 11.07.2014

Quote:
Originally Posted by CJsMom
Посмотреть сообщение
cool
This is a 3 year old thread and all you had to say was 'cool'? The only time it would be slightly allowed to bump an old thread would be for a legitimate reason but all you did was say 'cool'.