Hallo,
ich will das nur die Team fahren können, aber bekomme 2 errors, das habe ich:
Error:
error 032: array index out of bounds (variable "copcar")
error 032: array index out of bounds (variable "mafiacar")
Die Errors sind bei den Cars jeweils die letzte Zeile
//Cars
new copcar[18];
new mafiacar[20];
//Polizei Fahrzeuge
copcar[0] = AddStaticVehicle(427,1603.7855,-1608.5659,13.6376,178.4725,0,1); // PolizeiEnforcer 1
copcar[1] = AddStaticVehicle(427,1598.0254,-1607.8481,13.5733,178.9632,0,1); // PolizeiEnforcer 2
copcar[2] = AddStaticVehicle(427,1592.5045,-1608.0096,13.5189,178.5793,0,1); // PolizeiEnforcer 3
copcar[3] = AddStaticVehicle(427,1586.7395,-1608.0833,13.5148,178.7516,0,1); // PolizeiEnforcer 4
copcar[4] = AddStaticVehicle(427,1581.9268,-1607.7037,13.5147,178.0450,0,1); // PolizeiEnforcer 5
copcar[5] = AddStaticVehicle(596,1570.5522,-1607.2411,13.1042,178.5272,0,1); // PolizeiAuto 7
copcar[6] = AddStaticVehicle(596,1566.3879,-1606.9556,13.1042,178.8037,0,1); // PolizeiAuto 8
copcar[7] = AddStaticVehicle(596,1562.0411,-1606.6685,13.1042,178.7900,0,1); // PolizeiAuto 9
copcar[8] = AddStaticVehicle(599,1545.7119,-1615.0981,13.5723,270.4102,0,1); // PolizeiJeep 11
copcar[9] = AddStaticVehicle(599,1545.8092,-1610.0946,13.5710,270.2557,0,1); // PolizeiJeep 12
copcar[10] = AddStaticVehicle(599,1545.7599,-1605.0392,13.5726,270.9627,0,1); // PolizeiJeep 13
copcar[11] = AddStaticVehicle(523,1605.1315,-1630.6987,13.0918,90.4368,0,0); // PolizeiMotorrad 14
copcar[12] = AddStaticVehicle(523,1604.9148,-1628.4031,13.0887,90.0730,0,0); // PolizeiMotorrad 15
copcar[13] = AddStaticVehicle(523,1604.7166,-1626.3622,13.0874,90.7656,0,0); // PolizeiMotorrad 16
copcar[14] = AddStaticVehicle(523,1604.7373,-1624.4265,13.0855,90.9977,0,0); // PolizeiMotorrad 17
copcar[15] = AddStaticVehicle(523,1604.8424,-1622.4253,13.0876,90.9957,0,0); // PolizeiMotorrad 18
copcar[16] = AddStaticVehicle(523,1604.5532,-1620.2802,13.0805,90.1311,0,0); // PolizeiMotorrad 19
copcar[17] = AddStaticVehicle(497,1565.4830,-1655.4453,28.5730,358.7146,0,1); // Polizei Heli 20
copcar[18] = AddStaticVehicle(497,1565.7003,-1645.2936,28.5802,269.0209,0,1); // Polizei Heli 21
//Mafia Fahrzeuge
mafiacar[0] = AddStaticVehicle(402,1087.4744,-1250.8728,15.6589,359.2153,0,0); // MafiaAuto 1
mafiacar[1] = AddStaticVehicle(402,1091.2317,-1250.0966,15.6588,359.3017,0,0); // MafiaAuto 2
mafiacar[2] = AddStaticVehicle(402,1096.3784,-1250.7358,15.6571,359.0631,0,0); // MafiaAuto 3
mafiacar[3] = AddStaticVehicle(402,1100.5239,-1250.1610,15.6538,359.5387,0,0); // MafiaAuto 4
mafiacar[4] = AddStaticVehicle(402,1104.7896,-1250.6335,15.6520,359.7735,0,0); // MafiaAuto 5
mafiacar[5] = AddStaticVehicle(451,1109.8159,-1227.3224,15.5279,181.1787,0,0); // MafiaTurismo 6
mafiacar[6] = AddStaticVehicle(451,1105.2802,-1227.4161,15.5339,181.0406,0,0); // MafiaTurismo 7
mafiacar[7] = AddStaticVehicle(451,1100.8446,-1227.3027,15.5273,181.1379,0,0); // MafiaTurismo 8
mafiacar[8] = AddStaticVehicle(451,1096.6696,-1227.0038,15.5264,181.1659,0,0); // MafiaTurismo 9
mafiacar[9] = AddStaticVehicle(451,1092.6292,-1227.0093,15.5264,181.0436,0,0); // MafiaTurismo 10
mafiacar[10] = AddStaticVehicle(461,1095.1047,-1219.9535,17.3808,351.3861,0,0); // MafiaMotorrad 11
mafiacar[11] = AddStaticVehicle(461,1097.2728,-1219.6458,17.3733,351.0743,0,0); // MafiaMotorrad 12
mafiacar[12] = AddStaticVehicle(461,1101.5051,-1219.4642,17.3878,351.5267,0,0); // MafiaMotorrad 13
mafiacar[13] = AddStaticVehicle(461,1099.3617,-1219.5437,17.3750,351.1716,0,0); // MafiaMotorrad 14
mafiacar[14] = AddStaticVehicle(461,1103.5846,-1219.5968,17.3777,351.3860,0,0); // MafiaMotorrad 15
mafiacar[15] = AddStaticVehicle(487,1128.7709,-1222.9833,25.4790,91.9463,0,0); // Mafia Heli 16
mafiacar[16] = AddStaticVehicle(487,1129.1904,-1238.1340,25.4787,91.3860,0,0); // Mafia Heli 17
mafiacar[17] = AddStaticVehicle(563,1141.8539,-1173.2039,32.7328,152.3813,0,0); // Mafia Heli 18
mafiacar[18] = AddStaticVehicle(522,1087.3054,-1197.0695,17.9972,272.1918,0,0); // Mafia Jeep 19
mafiacar[19] = AddStaticVehicle(522,1087.5648,-1201.0959,17.8310,272.3942,0,0); // Mafia Jeep 20
mafiacar[20] = AddStaticVehicle(522,1087.2483,-1192.4657,18.1674,272.1931,0,0); // Mafia Jeep 21
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i;i<sizeof(copcar);i++)
{
if(GetPlayerVehicleID(playerid) == copcar[i])
{
if(gTeam[playerid] != Cops)
{
RemovePlayerFromVehicle(playerid);
return GameTextForPlayer(playerid, "Du bist kein Polizist!", 5000,3);
}
}
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i;i<sizeof(mafiacar);i++)
{
if(GetPlayerVehicleID(playerid) == mafiacar[i])
{
if(gTeam[playerid] != Mafia)
{
RemovePlayerFromVehicle(playerid);
return GameTextForPlayer(playerid, "Du bist nicht bei der Mafia!", 5000,3);
}
}
}
}
return 1;
}