Hallo,
ich habe mehrere Errors die ich nicht wegbekomme.
Hier sind die Errors:
A:\Mark\Desktop\Stunt\gamemodes\gamemode.pwn(1440) : error 033: array must be indexed (variable "PlayersInDeagle")
A:\Mark\Desktop\Stunt\gamemodes\gamemode.pwn(1463) : error 033: array must be indexed (variable "PlayersInDeagle")
A:\Mark\Desktop\Stunt\gamemodes\gamemode.pwn(1502) : error 033: array must be indexed (variable "PlayersInDeagle")
Hier ist der Code:
if (strcmp("/deagle", cmdtext, true, 10) == 0)
{
if(PlayerInDM == 0)
{
new name[MAX_PLAYER_NAME], germanstring[100], englishstring[100];
GetPlayerName(playerid, name, sizeof(name));
if(PlayersInDeagle < 10)
{
for(new i=0;i<GetMaxPlayers();i++)
{
if(PlayerInDeagle == 1) //Zeile 1440
{
switch(i)
{
case 1: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,328.4060400);/*unten*/ }
case 2: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,328.4060400);/*unten*/ }
case 3: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,328.4060400);/*unten*/ }
case 4: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,328.4060400);/*unten*/ }
case 5: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,328.4060400);/*unten*/ }
case 6: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,528.4060400);/*weiter oben*/ }
case 7: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,528.4060400);/*weiter oben*/ }
case 8: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,528.4060400);/*weiter oben*/ }
case 9: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,528.4060400);/*weiter oben*/ }
case 10: { SetPlayerPos(playerid,4945.6430700,-4108.7656300,528.4060400);/*weiter oben*/ }
}
}
}
PlayerInDM = 1;
PlayerInDeagle = 1;
PlayersInDeagle + 1; // Zeile 1463
SendPlayerMessage(playerid, GREEN, "Zur Deagle Arena teleportiert.", "Teleported to deagle cage.");
format(germanstring,sizeof(germanstring),"%s hat sich zur Deagle Arena teleportiert. (/deagle)",name);
format(englishstring,sizeof(englishstring),"%s teleported to deagle cage. (/deagle)",name);
SendAllPlayerMessage(LIGHTBLUE, germanstring, englishstring);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
GivePlayerWeapon(playerid, 24, 500);
}
else { SendPlayerMessage(playerid, RED, "Du bist schon im DM!", "You already in dm!"); }
}
else { SendPlayerMessage(playerid, RED, "Die Deagle Arena ist voll!", "The deagle cage is full!"); }
return 1;
}
if (strcmp("/exit", cmdtext, true, 10) == 0)
{
if(PlayerInDM == 1)
{
PlayerInDM = 0;
SpawnPlayer(playerid);
if(PlayerInDeagle == 1) { PlayerInDeagle = 0; PlayersInDeagle - 1; } // Zeile 1502
else if(PlayerInMinigun == 1) { PlayerInMinigun = 0; }
}
else { SendPlayerMessage(playerid, RED, "Du bist nicht im DM oder Rennen!", "You are not in dm or race!"); }
return 1;
}
return 0;
}
Hier definiere ich die Arrays(müsste der Fehler sein):
Danke im voraus.
Grüße
Mark