Hallo Leute,
ich bekomme bei dem befehl /carkey errors, ich weiß aber nicht wieso :O
- bitte um Hilfe
(Errors)
(14286) : error 032: array index out of bounds (variable "PlayerHaveCar")
(14286) : error 032: array index out of bounds (variable "PlayerCar")
(14288) : error 032: array index out of bounds (variable "PlayerHaveCar")
(14288) : error 032: array index out of bounds (variable "PlayerCar")
(14290) : error 032: array index out of bounds (variable "PlayerHaveCar")
(14290) : error 032: array index out of bounds (variable "PlayerCar")
(Befehl)
if(strcmp(cmd, "/carkey", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new c1[30], c2[30], c3[30], c4[30], c5[30], stringo[128];
if(PlayerHaveCar[playerid][0]){ format(c1, sizeof(c1), "{FFFFFF}%s", CarName[PlayerCar[playerid][0][CarModel]-400]); }
else { format(c1, sizeof(c1), "{FFFFFF}-------"); }
if(PlayerHaveCar[playerid][1]){ format(c2, sizeof(c2), "{FFFFFF}%s", CarName[PlayerCar[playerid][1][CarModel]-400]); }
else { format(c2, sizeof(c2), "{FFFFFF}-------"); }
if(PlayerHaveCar[playerid][2]){ format(c3, sizeof(c3), "{FFFFFF}%s", CarName[PlayerCar[playerid][2][CarModel]-400]); } // zeile 14286
else { format(c3, sizeof(c3), "{FFFFFF}-------"); }
if(PlayerHaveCar[playerid][3]){ format(c4, sizeof(c4), "{FFFFFF}%s", CarName[PlayerCar[playerid][3][CarModel]-400]); }
else { format(c4, sizeof(c4), "{FFFFFF}-------"); }
if(PlayerHaveCar[playerid][4]){ format(c5, sizeof(c5), "{FFFFFF}%s", CarName[PlayerCar[playerid][4][CarModel]-400]); }
else { format(c5, sizeof(c5), "{FFFFFF}-------"); }
format(stringo, sizeof(stringo), "%s\n%s\n%s\n%s\n%s", c1, c2, c3, c4, c5);
ShowPlayerDialog(playerid, DIALOG_CARKEY, DIALOG_STYLE_LIST, "Autoschlüssel", stringo, "Auswählen", "Abbrechen");
}
return 1;
}
Danke im Voraus =)