12.08.2010, 13:15
Array;
Anywhere;
Example;
Error;
PHP код:
new VehicleCols[][] =
{
{4,1, 123,1, 113,1, 101,1, 75,1, 62,1, 40,1, 36,1},
{41,41, 47,47, 52,52, 66,66, 74,74, 87,87,91,91, 113,113},
{10,10, 13,13, 22,22, 30,30, 39,39, 90,90, 98,98, 110,110},
{36,1, 37,1, 30,1, 28,1, 25,1, 40,1, 101,1, 113,1},
{113,39, 119,50, 123,92, 109,100, 101,101, 95,105, 83,110, 66,25},
{11,1, 24,1, 36,1, 40,1, 75,1, 91,1, 123,1, 4,1},
{1,1},
{3,1},
{26,26},
{1,1},
{4,1, 9,1, 10,1, 25,1, 36,1, 40,1, 45,1, 84,1},
{12,1, 64,1, 123,1, 116,1, 112,1, 106,1, 80,1, 75,1},
{9,1, 10,8, 11,1, 25,8, 27,1, 29,8, 30,1, 37,8},
{87,1, 88,1, 91,1, 105,1, 109,1, 119,1, 4,1, 25,1},
{25,1, 28,1, 43,1, 67,1},
{72,1, 9,1, 95,1, 24,1},
{20,1, 25,1, 36,1, 40,1, 62,1, 75,1, 92,1, 0,1},
{1,3},
{1,1}, // leviathn none
{119,119, 117,227, 114,114, 108,108, 95,95, 81,81, 61,61, 41,41},
{45,75, 47,76, 33,75, 13,76, 54,75, 69,76, 59,75, 87,76},
{6,1},
{4,1, 13,1, 25,1, 30,1, 36,1, 40,1, 75,1, 95,1},
{96,25, 97,25, 101,25, 111,31, 113,36, 83,57, 67,59},
{1,16, 1,56, 1,17, 1,53, 1,5, 1,35},
{1,0, 2,2, 3,2, 3,6, 6,16, 15,30, 24,53, 35,61},
{43,0},
{37,37, 42,42, 53,53, 62,62, 7,7, 10,10, 11,11, 15,15},
{0,1},
{4,75},
{12,12, 13,13, 14,14, 1,2, 2,1, 1,3, 3,1, 10,10},
{46,26},
{71,59, 75,59, 92,72, 47,74, 55,83, 59,83, 71,87, 82,87},
{43,0},
{43,0},
{1,1, 12,12, 2,2, 6,6, 4,4, 46,46, 53,53},
{1,1},
{83,1, 87,1, 92,1, 95,1, 109,1, 119,45, 11,1},
{54,7, 79,7, 87,7, 95,16, 98,20, 105,20, 123,20, 125,21},
{6,76},
{57,8, 8,17, 43,21, 54,38, 67,8, 37,78, 65,79, 25,78},
{34,34, 32,32, 20,20, 110,110, 66,66, 84,84, 118,118, 121,121},
{2,96, 79,42, 82,54, 67,86, 126,96, 70,96, 110,54, 67,98},
{0,0, 11,105, 25,109, 36,0, 40,36, 75,36, 0,36, 0,109},
{4,1, 20,1, 24,1, 25,1, 36,1, 40,1, 54,1, 84,1},
{32,36, 32,42, 32,53, 32,66, 32,14, 32,32},
{34,34, 35,35, 37,37, 39,39, 41,41, 43,43, 45,45, 47,47},
{1,1}, // squalo special
{75,2},
{3,6},
{1,74},
{1,1},
{123,123, 125,125, 36,36, 16,16, 18,18, 46,46, 61,61, 75,75},
{1,3, 1,5, 1,16, 1,22, 1,35, 1,44, 1,53, 1,57},
{56,56},
{26,26},
{84,15, 84,58, 84,31, 32,74, 43,31, 1,31, 77,31, 32,74},
{84,63, 91,63, 102,65, 105,72, 110,93, 121,93, 12,95, 23,1},
{58,1, 2,1, 63,1, 18,1, 32,1, 45,1, 13,1, 34,1},
{91,1, 101,1, 109,1, 113,1, 4,1, 25,1, 30,1, 36,1},
{26,26, 28,28, 44,44, 51,51, 57,57, 72,72, 106,106, 112,112},
{1,3, 1,9, 1,18, 1,30, 17,23, 46,23, 46,32, 57,34},
{36,1, 37,1, 43,1, 53,1, 61,1, 75,1, 79,1, 88,1},
{12,12, 13,13, 14,14, 1,2, 2,1, 1,3, 3,1, 10,10},
{79,79, 84,84, 7,7, 11,11, 19,19, 22,22, 36,36, 53,53},
{14,75},
{14,75},
{67,76, 68,76, 78,76, 2,76, 16,76, 18,76, 25,76, 45,88},
{51,1, 58,8, 60,1, 68,8, 2,1, 13,8, 22,1, 36,8},
{6,6, 46,46, 53,53, 3,3},
{1,3},
{43,0},
{120,117, 103,111, 120,114, 74,91, 120,112, 74,83, 120,113, 66,71},
{56,15, 56,53},
{56,15, 56,53},
{97,1, 81,1, 105,1, 110,1, 91,1, 74,1, 84,1, 83,1},
{2,39, 9,39, 17,1, 21,1, 33,0, 37,0, 41,29, 56,29},
{6,7, 7,6, 1,6, 89,91, 119,117, 103,102, 77,87, 71,77},
{92,1, 94,1, 101,1, 121,1, 0,1, 22,1, 36,1, 75,1},
{72,1, 66,1, 59,1, 45,1, 40,1, 39,1, 35,1, 20,1},
{27,36, 59,36, 60,35, 55,41, 54,31, 49,23, 45,32, 40,29},
{73,45, 12,12, 2,2, 6,6, 4,4, 46,46, 53,53},
{1,1, 3,3, 6,6, 46,46, 65,9, 14,1, 12,9, 26,1},
{41,41, 48,48, 52,52, 64,64, 71,71, 85,85, 10,10, 62,62},
{1,1}, // camper special
{12,35, 50,32, 40,26, 66,36},
{1,73, 1,74, 1,75, 1,76, 1,77, 1,78, 1,79},
{1,1},
{26,14, 29,42, 26,57, 54,29, 26,3, 3,29, 12,39, 74,35},
{2,26, 2,29},
{13,118, 14,123, 120,123, 112,120, 84,110, 76,102},
{0,0},
{40,65, 71,72, 52,66, 64,72, 30,72, 60,72},
{30,26, 77,26, 81,27, 24,55, 28,56, 49,59, 52,69, 71,107},
{36,13},
{36,117, 36,13, 42,30, 42,33, 54,36, 75,79, 92,101, 98,109},
{123,124, 119,122, 118,117, 116,115, 114,108, 101,106, 88,99, 5,6},
{74,72, 66,72, 53,56, 37,19, 22,22, 20,20, 9,14, 0,0},
{0,1},
{11,123, 13,120, 20,117, 24,112, 27,107, 36,105, 37,107, 43,93},
{109,25, 109,32, 112,32, 10,32, 30,44, 32,52, 84,66, 84,69},
{75,84, 40,84, 40,110, 28,119, 25,119, 21,119, 13,119, 4,119},
{14,75},
{7,94, 36,88, 51,75, 53,75 ,58,67, 75,67, 75,61, 79,62},
{83,66, 87,74, 87,75, 98,83, 101,100, 103,101, 117,116, 123,36},
{51,39, 57,38, 45,29, 34,9, 65,9, 14,1, 12,9, 26,1},
{13,118, 14,123, 120,123, 112,120, 84,110, 76,102}, // Rancher lure
{3,3, 6,6, 7,7, 52,52, 76,76},
{37,37, 42,42, 53,53, 62,62, 7,7, 10,10, 11,11, 15,15},
{1,1},
{7,1, 74,1, 61,1, 16,1, 25,1, 30,1, 36,1, 53,1},
{43,43, 46,46, 39,39, 28,28, 16,16, 6,6, 5,5, 2,2},
{3,90, 4,90, 7,68, 8,66, 12,60, 27,97, 34,51, 37,51},
{17,39, 15,123, 32,112, 45,88, 52,71, 57,67, 61,96, 96,96},
{38,51, 21,36, 21,34, 30,34, 54,34, 55,20, 48,18, 51,6},
{10,1, 25,1, 28,1, 36,1, 40,1, 54,1, 75,1, 113,1},
{13,76, 24,77, 63,78, 42,76, 54,77, 39,78, 11,76, 62,77},
{116,1, 119,1, 122,1, 4,1, 9,1, 24,1, 27,1, 36,1},
{37,36, 36,36, 40,36, 43,41, 47,41, 51,72, 54,75, 55,84},
{2,39, 9,39, 17,1, 21,1, 33,0, 37,0, 41,29, 56,29},
{1,1},
{1,1}, // hydra none
{74,74, 75,13, 87,118, 92,3, 115,118, 25,118, 36,0, 118,118},
{3,3, 3,8, 6,25, 7,79, 8,82, 36,105, 39,106, 51,118},
{1,1}, // copbike none
{1,1}, // cement special
{1,1, 17,20, 18,20, 22,30, 36,43, 44,51, 52,54},
{2,39, 9,39, 17,1, 21,1, 33,0, 37,0, 41,29, 56,29},
{52,1, 53,1, 66,1, 75,1, 76,1, 81,1, 95,1, 109,1},
{1,1}, // fbitruck none
{37,37, 42,42, 53,53, 62,62, 7,7, 10,10, 11,11, 15,15},
{110,1, 111,1, 112,1, 114,1, 119,1, 122,1, 4,1, 13,1},
{2,35, 36,2, 51,53, 91,2, 11,22, 40,35},
{1,1}, // combine none
{73,1, 74,1, 75,1, 77,1, 79,1, 83,1, 84,1, 91,1},
{37,37, 42,42, 53,53, 62,62, 7,7, 10,10, 11,11, 15,15},
{3,1, 28,1, 31,1, 55,1, 66,1, 97,1, 123,1, 118,1},
{9,1, 12,1, 26,96, 30,96, 32,1, 37,1, 57,96, 71,96},
{1,1},
{1,1},
{96,67, 86,70, 79,74, 70,86, 61,98, 75,75, 75,91},
{37,37, 42,42, 53,53, 62,62, 7,7, 10,10, 11,11, 15,15},
{51,1, 58,8, 60,1, 68,8, 2,1, 13,8, 22,1, 36,8},
{13,118, 24,118, 31,93, 32,92, 45,92, 113,92, 119,113, 122,113},
{76,8, 32,8, 43,8, 67,8, 11,11, 8,90, 2,2, 83,13},
{3,1},
{50,1, 47,1, 44,96, 40,96, 39,1, 30,1, 28,96, 9,96},
{62,37, 78,38, 2,62, 3,87, 2,78, 113,78, 119,62, 7,78},
{122,1, 123,1, 125,1, 10,1, 24,1, 37,1, 55,1, 66,1},
{1,1},
{74,39, 72,39, 75,39, 79,39, 83,36, 84,36, 89,35, 91,35},
{37,37, 42,42, 53,53, 62,62, 7,7, 10,10, 11,11, 15,15},
{67,1, 72,1, 75,1, 83,1, 91,1, 101,1, 109,1, 20,1},
{56,56, 49,49, 26,124},
{38,9, 55,23, 61,74, 71,87, 91,87, 98,114, 102,119, 111,3},
{53,32, 15,32, 45,32, 34,30, 65,32, 14,32, 12,32, 43,32},
{51,1, 58,1, 60,1, 68,1, 2,1, 13,1, 22,1, 36,1},
{1,1},
{1,1},
{112,1, 116,1, 117,1, 24,1, 30,1, 35,1, 36,1, 40,1},
{51,1, 58,8, 60,1, 68,8, 2,1, 13,8, 22,1, 36,8},
{52,39, 9,39, 17,1, 21,1, 33,0, 37,0, 41,29, 56,29},
{57,8, 8,17, 43,21, 54,38, 67,8, 37,78, 65,79, 25,78},
{36,1, 35,1, 17,1, 11,1, 116,1, 113,1, 101,1, 92,1},
{1,6},
{1,1}, // rctiger none
{37,37, 42,42, 53,53, 62,62, 7,7, 10,10, 11,11, 15,15},
{109,1, 30,8, 95,1, 84,8, 83,1, 72,8, 71,1, 52,8},
{97,96, 88,64, 90,96, 93,64, 97,96, 99,81, 102,114, 114,1},
{2,39, 9,39, 17,1, 21,1, 33,0, 37,0, 41,29, 56,29},
{1,1},
{1,1},
{2,35, 36,2, 51,53, 91,2, 11,22, 40,35},
{94,1, 101,1, 116,1, 117,1, 4,1, 25,1, 30,1, 37,1},
{91,38, 115,43, 85,6, 79,7, 78,8, 77,18, 79,18, 86,24},
{26,26},
{12,1, 19,96, 31,64, 25,96, 38,1, 51,96, 57,1, 66,96},
{67,1, 68,96, 72,1, 74,8, 75,96, 76,8, 79,1, 84,96},
{1,3, 8,7, 8,10, 8,16, 23,31, 40,44},
{1,1},
{37,37, 42,42, 53,53, 62,62, 7,7, 10,10, 11,11, 15,15},
{92,92, 81,81, 67,67, 66,66, 61,61, 53,53, 51,51, 47,47, 43,43},
{54,1, 58,1, 66,1, 72,1, 75,1, 87,1, 101,1, 36,1},
{41,10, 41,20, 49,11, 56,123, 110,113, 112,116, 114,118, 119,101},
{1,1},
{1,1},
{37,37, 42,42, 53,53, 62,62, 7,7, 10,10, 11,11, 15,15},
{119,1, 122,1, 8,1, 10,1, 13,1, 25,1, 27,1, 32,1},
{36,1, 40,1, 43,1, 53,1, 72,1, 75,1, 95,1, 101,1},
{1,1},
{37,37, 31,31, 23,23, 22,22, 7,7, 124,124, 114,114, 112,112},
{1,1}, // freibox none
{1,1},
{1,1},
{51,1, 58,8, 60,1, 68,8, 2,1, 13,8, 22,1, 36,8},
{1,1}, // rccam none
{112,20},
{0,1},
{0,1},
{0,1},
{0,1},
{81,8, 32,8, 43,8, 67,8, 11,11, 8,90, 2,2, 83,13},
{1,1},
{58,1, 69,1, 75,77, 18,1, 32,1, 45,45, 13,1, 34,1},
{58,1, 69,1, 75,77, 18,1, 32,1, 45,45, 13,1, 34,1},
{67,76, 68,76, 78,76, 2,76, 16,76, 18,76, 25,76, 45,88},
{61,8, 32,8, 43,8, 67,8, 11,11, 8,90, 2,2, 83,13},
{1,1}, // bagboxa none
{1,1}, // bagboxb none
{1,1},
{36,36}, // boxburg
{1,1}, // farmtr1 none
{1,1} // utiltr1 none
};
PHP код:
stock GetVehicleColor(modelid, &color1=0, &color2=0)
{
if(modelid < 400 || modelid >> 611) return 0;
new rand = random(sizeof(VehicleCols[modelid-400])/2); // Line 563
color1 = VehicleCols[modelid-400][rand * 2];
color2 = VehicleCols[modelid-400][rand * 2 + 1];
return 1;
}
PHP код:
new color1, color2;
GetVehicleColor(450, color1, color2);
printf("%i", color1);
printf("%i", color2);
Код:
C:\Users\Vetle\sampie\gamemodes\gm.pwn(563) : error 001: expected token: "]", but found "-identifier-" C:\Users\Vetle\sampie\gamemodes\gm.pwn(563) : warning 215: expression has no effect C:\Users\Vetle\sampie\gamemodes\gm.pwn(563) : error 001: expected token: ";", but found "]" C:\Users\Vetle\sampie\gamemodes\gm.pwn(563) : error 029: invalid expression, assumed zero C:\Users\Vetle\sampie\gamemodes\gm.pwn(563) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.