26 Errors

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Warscheinlich ist es ein Klammerfehler, aber ich finde ihn nicht, weil ich einfach alles so da hingeklatscht hab und nicht mehr weiter weiß ... xD


    if(world1[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 2220.8381,-1153.0044,1025.7969);
    SetPlayerInterior(playerid, 15);
    }
    else
    {
    SetPlayerPos(player, 2201.2527,-1143.9147,1029.7969);
    SetPlayerInterior(playerid, 15);
    }
    }
    if(world2[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 1301.5267,-791.6212,1084.0149);
    SetPlayerInterior(playerid, 5);
    }
    else
    {
    SetPlayerPos(player, 1264.6923,-773.4435,1091.9063);
    SetPlayerInterior(playerid, 5);
    }
    }
    if(world3[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 2152.2529,1600.2825,1006.1741);
    SetPlayerInterior(playerid, 1);
    }
    else
    {
    SetPlayerPos(player, 2235.8574,1678.7686,1008.3594);
    SetPlayerInterior(playerid, 1);
    }
    }


    Da kommt z.B. "undefined symbol killerid". Das kann ja nur ein Klammerfehler sein.


    PS: Oder kennt jemand ne bessere Methode für Respawn an einer bestimmten Position? Ich mache nämlich gerade Random Spawns, also die ändern sich alle 12 Minuten.
    Und weiß halt nicht ob das so mit bools die beste Methode für OnPlayerSpawn ist ...

  • Ich habe es jetzt mal so:


    if(world1[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 2220.8381,-1153.0044,1025.7969);
    SetPlayerInterior(playerid, 15);
    }
    else
    {
    SetPlayerPos(player, 2201.2527,-1143.9147,1029.7969);
    SetPlayerInterior(playerid, 15);
    }
    if(world2[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 1301.5267,-791.6212,1084.0149);
    SetPlayerInterior(playerid, 5);
    }
    else
    {
    SetPlayerPos(player, 1264.6923,-773.4435,1091.9063);
    SetPlayerInterior(playerid, 5);
    }
    if(world3[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 2152.2529,1600.2825,1006.1741);
    SetPlayerInterior(playerid, 1);
    }
    else
    {
    SetPlayerPos(player, 2235.8574,1678.7686,1008.3594);
    SetPlayerInterior(playerid, 1);
    }
    }


    Leider immer noch 26 Errors.


    //edit


    Richtiger Code

  • if(world1[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 2220.8381,-1153.0044,1025.7969);
    SetPlayerInterior(playerid, 15);
    }
    else
    {
    SetPlayerPos(player, 2201.2527,-1143.9147,1029.7969);
    SetPlayerInterior(playerid, 15);
    }
    if(world2[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 1301.5267,-791.6212,1084.0149);
    SetPlayerInterior(playerid, 5);
    }
    }
    else
    {
    SetPlayerPos(player, 1264.6923,-773.4435,1091.9063);
    SetPlayerInterior(playerid, 5);
    }
    if(world3[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 2152.2529,1600.2825,1006.1741);
    SetPlayerInterior(playerid, 1);
    }
    }
    else
    {
    SetPlayerPos(player, 2235.8574,1678.7686,1008.3594);
    SetPlayerInterior(playerid, 1);
    }
    }

  • if(world1[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 2220.8381,-1153.0044,1025.7969);
    SetPlayerInterior(playerid, 15);
    }
    else
    {
    SetPlayerPos(player, 2201.2527,-1143.9147,1029.7969);
    SetPlayerInterior(playerid, 15);
    }
    if(world2[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 1301.5267,-791.6212,1084.0149);
    SetPlayerInterior(playerid, 5);
    }
    else
    {
    SetPlayerPos(player, 1264.6923,-773.4435,1091.9063);
    SetPlayerInterior(playerid, 5);
    }
    if(world3[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(player, 2152.2529,1600.2825,1006.1741);
    SetPlayerInterior(playerid, 1);
    }
    else
    {
    SetPlayerPos(player, 2235.8574,1678.7686,1008.3594);
    SetPlayerInterior(playerid, 1);
    }
    }
    return 1;
    }


    versuch mal so^^

  • nein mkingcan daran liegt es nicht es.
    Er hatte hier
    if(world2[playerid] == true)
    und hier
    if(world3[playerid] == true)


    klammern zu wenig

  • Leider noch 25 Errors (alle undefined symbol playerid).


    Hier jetzt mal das ganze Public:


    public OnPlayerSpawn(playerid)
    {
    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.cer",pname);
    if(world1[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(playerid, 2220.8381,-1153.0044,1025.7969);
    SetPlayerInterior(playerid, 15);
    }
    else
    {
    SetPlayerPos(playerid, 2201.2527,-1143.9147,1029.7969);
    SetPlayerInterior(playerid, 15);
    }
    if(world2[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(playerid, 1301.5267,-791.6212,1084.0149);
    SetPlayerInterior(playerid, 5);
    }
    }
    else
    {
    SetPlayerPos(playerid, 1264.6923,-773.4435,1091.9063);
    SetPlayerInterior(playerid, 5);
    }
    if(world3[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(playerid, 2152.2529,1600.2825,1006.1741);
    SetPlayerInterior(playerid, 1);
    }
    }
    else
    {
    SetPlayerPos(playerid, 2235.8574,1678.7686,1008.3594);
    SetPlayerInterior(playerid, 1);
    }
    }


    if(gTeam[playerid] == 0)
    {
    GivePlayerWeapon(playerid, 4, 1);
    GivePlayerWeapon(playerid, 24, 100);
    GivePlayerWeapon(playerid, 27, 450);
    GivePlayerWeapon(playerid, 30, 450);

    }
    else
    {
    GivePlayerWeapon(playerid, 41, 500);
    GivePlayerWeapon(playerid, 24, 100);
    GivePlayerWeapon(playerid, 25, 100);
    GivePlayerWeapon(playerid, 31, 500);
    }
    return 1;
    }


    //edit


    Zu wenig Code war es erst ..

  • public OnPlayerSpawn(playerid)
    {
    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.cer",pname);
    if(world1[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(playerid, 2220.8381,-1153.0044,1025.7969);
    SetPlayerInterior(playerid, 15);
    }
    else
    {
    SetPlayerPos(playerid, 2201.2527,-1143.9147,1029.7969);
    SetPlayerInterior(playerid, 15);
    }
    if(world2[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(playerid, 1301.5267,-791.6212,1084.0149);
    SetPlayerInterior(playerid, 5);
    }
    else
    {
    SetPlayerPos(playerid, 1264.6923,-773.4435,1091.9063);
    SetPlayerInterior(playerid, 5);
    }
    if(world3[playerid] == true)
    {
    if(gTeam[playerid] == TEAM_1)
    {
    SetPlayerPos(playerid, 2152.2529,1600.2825,1006.1741);
    SetPlayerInterior(playerid, 1);
    }
    }
    else
    {
    SetPlayerPos(playerid, 2235.8574,1678.7686,1008.3594);
    SetPlayerInterior(playerid, 1);
    }
    if(gTeam[playerid] == 0)
    {
    GivePlayerWeapon(playerid, 4, 1);
    GivePlayerWeapon(playerid, 24, 100);
    GivePlayerWeapon(playerid, 27, 450);
    GivePlayerWeapon(playerid, 30, 450);

    }
    else
    {
    GivePlayerWeapon(playerid, 41, 500);
    GivePlayerWeapon(playerid, 24, 100);
    GivePlayerWeapon(playerid, 25, 100);
    GivePlayerWeapon(playerid, 31, 500);
    }
    }
    return 1;
    }

  • Probiere es mal so ich glaube nicht das es geht aber ein versuch wär es wert.
    if(world1[i] == true)
    {
    if(gTeam[i] == TEAM_1)
    {
    SetPlayerPos(player, 2220.8381,-1153.0044,1025.7969);
    SetPlayerInterior(i, 15);
    }
    else
    {
    SetPlayerPos(player, 2201.2527,-1143.9147,1029.7969);
    SetPlayerInterior(i, 15);
    }
    if(world2[i] == true)
    {
    if(gTeam[i] == TEAM_1)
    {
    SetPlayerPos(player, 1301.5267,-791.6212,1084.0149);
    SetPlayerInterior(i, 5);
    }
    }
    else
    {
    SetPlayerPos(player, 1264.6923,-773.4435,1091.9063);
    SetPlayerInterior(i, 5);
    }
    if(world3[i] == true)
    {
    if(gTeam[i] == TEAM_1)
    {
    SetPlayerPos(player, 2152.2529,1600.2825,1006.1741);
    SetPlayerInterior(i, 1);
    }
    }
    else
    {
    SetPlayerPos(player, 2235.8574,1678.7686,1008.3594);
    SetPlayerInterior(i, 1);
    }
    }

  • Ich glaube dann sind die errors woanders.
    Schau mal in den jewaligen zeilen.

  • dann probier das mal:
    if(world1[pname] == true)
    {
    if(gTeam[pname] == TEAM_1)
    {
    SetPlayerPos(pname, 2220.8381,-1153.0044,1025.7969);
    SetPlayerInterior(pname, 15);
    }
    else
    {
    SetPlayerPos(pname, 2201.2527,-1143.9147,1029.7969);
    SetPlayerInterior(pname, 15);
    }
    if(world2[pname] == true)
    {
    if(gTeam[pname] == TEAM_1)
    {
    SetPlayerPos(pname, 1301.5267,-791.6212,1084.0149);
    SetPlayerInterior(pname, 5);
    }
    }
    else
    {
    SetPlayerPos(pname, 1264.6923,-773.4435,1091.9063);
    SetPlayerInterior(pname, 5);
    }
    if(world3[pname] == true)
    {
    if(gTeam[pname] == TEAM_1)
    {
    SetPlayerPos(pname, 2152.2529,1600.2825,1006.1741);
    SetPlayerInterior(pname, 1);
    }
    }
    else
    {
    SetPlayerPos(pname, 2235.8574,1678.7686,1008.3594);
    SetPlayerInterior(i, 1);
    }
    }


    sonst weiß ich leider nicht mehr weiter tut mir leid.

  • Einfach einrücken mit TAB.... dann beheben sich solche Fehler wie von alleine, und es ist viel übersichtlicher. X(

    mfg RedDragon 8)


    Was ist GFKD?


    Ein revolutionärer Clan, dessen Eröffnung kurz bevorsteht.
    Mehr Informationen folgen bald.