Errors =O --> Help

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
  • bei mir kommen so einige errors =O

    \Desktop\Grand Theft Auto San Andreas\ReadMe\SA.MP Server 0.3e\gamemodes\GDS.pwn(1298) : error 003: declaration of a local variable must appear in a compound block
    \Desktop\Grand Theft Auto San Andreas\ReadMe\SA.MP Server 0.3e\gamemodes\GDS.pwn(1427) : error 033: array must be indexed (variable "MuellCheckpoint")
    \Desktop\Grand Theft Auto San Andreas\ReadMe\SA.MP Server 0.3e\gamemodes\GDS.pwn(1428) : error 017: undefined symbol "vehicleid"
    \Desktop\Grand Theft Auto San Andreas\ReadMe\SA.MP Server 0.3e\gamemodes\GDS.pwn(1429) : error 003: declaration of a local variable must appear in a compound block
    \Desktop\Grand Theft Auto San Andreas\ReadMe\SA.MP Server 0.3e\gamemodes\GDS.pwn(1429) : error 017: undefined symbol "vehicleid"
    \Desktop\Grand Theft Auto San Andreas\ReadMe\SA.MP Server 0.3e\gamemodes\GDS.pwn(1442) : warning 219: local variable "rand" shadows a variable at a preceding level
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    5 Errors.












    Hier der /duty befehl für Müllmann:
    if (strcmp("/Müllmann", cmdtext, true) == 0)
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    for(new i=0; i<11; i++)
    if(vehicleid == trash[i])
    new rand = random(sizeof(MuellCheckpoint)); //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Error 1 und 2
    SetPlayerCheckpoint(playerid,MuellCheckpoint[rand][0],MuellCheckpoint[rand][1],MuellCheckpoint[rand][2],3);//<<<<<<<<<<< Error 3
    return 1;
    }




    OnPlayerEnterCheckpoint:
    {
    if(MuellCheckpoint[playerid]) //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Error 4
    new vehicleid = GetPlayerVehicleID(playerid); //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Error 5 / 6
    if(vehicleid == trash[i]) // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Error 7
    for(new i=0; i<11; i++)
    SendClientMessage(playerid,Orange,"Müll abgeholt. Gehalt pro Checkpoint '25$'");
    DisablePlayerCheckpoint(playerid);
    TogglePlayerControllable(playerid, 0);//Timer setzen. In der Timer Funktion wird dann der neue CP gesetzt.
    SendClientMessage(playerid,Weiß,"Müll wird abgeholt...");
    GivePlayerMoney(playerid,25);
    SetTimerEx("Wiederfahren", 1000*3, 0, "i", playerid);
    return 1;
    }


    puplic weiterfahren
    public Wiederfahren(playerid)
    {
    TogglePlayerControllable(playerid,1);//Spieler entfreezen
    new rand = random(sizeof(MuellCheckpoint));
    SetPlayerCheckpoint(playerid,MuellCheckpoint[rand][0],MuellCheckpoint[rand][1],MuellCheckpoint[rand][2],3);
    return 1;
    }


  • if (strcmp("/Müllmann", cmdtext, true) == 0)
    {
    if(GetVehicleModel(GetPlayerVehicleID(playerid))==408/*Ist der Trashmaster*/)//Die Abfrage die hier vorher stand, war total sinn los :D
    {
    if(MuellCheckpoint[playerid]==1)
    {
    new rand = random(sizeof(MuellCheckpoint));
    SetPlayerCheckpoint(playerid,MuellCheckpoint[rand][0],MuellCheckpoint[rand][1],MuellCheckpoint[rand][2],3);
    SendClientMessage(playerid, 0xFFAAFF,"Müllmission begonnen!");
    MuellCheckpoint[playerid]=1;
    }
    else
    {
    SendClientMessage(playerid, 0xFFAAFF,"Müllmission beendet!");
    MuellCheckpoint[playerid]=0;
    }
    }
    else
    {
    SendClientMessage(playerid, 0xFFAAFF,"Du bist in keinem Müllwagen!");
    }
    return 1;
    }


    Edit:Variable für "Checkpoint" auf 1 setzen, damit es bei der OnPlayerEnterCheckpoint Abfrage auch klappt ;)



    Hinweis: Keinen Kontakt über TeamViewer oder Skype !
    Grüßt den Fehlerklärbär von mir.
    Coming soon: Pawn-Café ( Concept-Sharing | Scripting-First-Aid )

  • 26) : error 033: array must be indexed (variable "MuellCheckpoint")
    Error bleibt..


    Hier der Random Checkpoint da oben:



    new Float:MuellCheckpoint[30][3] =
    {
    {169.6573,-1775.9962,4.6257},
    {192.5336,-1774.9198,4.3294},
    {217.4171,-1774.5333,4.5115},
    {229.7396,-1774.3257,4.7038},
    {250.5187,-1775.1049,4.6746},
    {263.7420,-1774.9382,4.7421},
    {279.9657,-1774.9767,4.8313},
    {294.4379,-1775.5449,4.9649},
    {305.0468,-1775.8656,5.0814},
    {319.0228,-1776.3274,5.3367},
    {640.9071,-1708.2245,15.0204},
    {642.6404,-1693.7358,15.4755},
    {645.2234,-1649.3253,15.5110},
    {644.9119,-1636.7943,15.5746},
    {643.9793,-1618.5844,15.7069},
    {643.3240,-1603.5023,16.0275},
    {695.5063,-1592.4534,14.5792},
    {757.3008,-1606.4424,13.6257},
    {757.6164,-1656.3473,5.0249},
    {759.3180,-1697.6516,5.3899},
    {760.4110,-1746.6523,12.9823},
    {788.5297,-1763.2125,13.8119},
    {804.5416,-1734.7648,13.9948},
    {804.8804,-1707.9711,14.0094},
    {805.0916,-1690.4871,14.0102},
    {791.6443,-1668.9718,13.9375},
    {643.1573,-1536.1619,15.7150},
    {642.5355,-1488.4122,15.2151},
    {642.8460,-1443.1581,14.7281},
    {208.3698,-1774.6583,4.3892}
    };

  • new Float:MuellCheckpoint[30][3] =
    {
    {169.6573,-1775.9962,4.6257},
    {192.5336,-1774.9198,4.3294},
    {217.4171,-1774.5333,4.5115},
    {229.7396,-1774.3257,4.7038},
    {250.5187,-1775.1049,4.6746},
    {263.7420,-1774.9382,4.7421},
    {279.9657,-1774.9767,4.8313},
    {294.4379,-1775.5449,4.9649},
    {305.0468,-1775.8656,5.0814},
    {319.0228,-1776.3274,5.3367},
    {640.9071,-1708.2245,15.0204},
    {642.6404,-1693.7358,15.4755},
    {645.2234,-1649.3253,15.5110},
    {644.9119,-1636.7943,15.5746},
    {643.9793,-1618.5844,15.7069},
    {643.3240,-1603.5023,16.0275},
    {695.5063,-1592.4534,14.5792},
    {757.3008,-1606.4424,13.6257},
    {757.6164,-1656.3473,5.0249},
    {759.3180,-1697.6516,5.3899},
    {760.4110,-1746.6523,12.9823},
    {788.5297,-1763.2125,13.8119},
    {804.5416,-1734.7648,13.9948},
    {804.8804,-1707.9711,14.0094},
    {805.0916,-1690.4871,14.0102},
    {791.6443,-1668.9718,13.9375},
    {643.1573,-1536.1619,15.7150},
    {642.5355,-1488.4122,15.2151},
    {642.8460,-1443.1581,14.7281},
    {208.3698,-1774.6583,4.3892},
    };


    probier ma so

  • Erstmal sind das im Array 29 Checkpoint-Koordinaten (zählen junge ^^ )
    Und da du das Array so gennant hast, kannst du das natürlich nichtmehr als Variable nutzen (als Integer jetzt).
    bitte erstelle oben im Script eine Variable : new bool:MuellJob[MAX_PLAYERS]; Ein Boolean um zwischenzuspeichern, ob der Spieler bereits in einer Mission ist, oder nicht.
    Dafür war doch die Abfrage gedacht, richtig?


    Ändere also ein paar Stellen:

    if (strcmp("/Müllmann", cmdtext, true) == 0)
    {
    if(GetVehicleModel(GetPlayerVehicleID(playerid))==408/*Ist der Trashmaster*/)//Die Abfrage die hier vorher stand, war total sinn los :D
    {
    if(MuellJob[playerid]==1)
    {
    new rand = random(sizeof(MuellCheckpoint));
    SetPlayerCheckpoint(playerid,MuellCheckpoint[rand][0],MuellCheckpoint[rand][1],MuellCheckpoint[rand][2],3);
    SendClientMessage(playerid, 0xFFAAFF,"Müllmission begonnen!");
    MuellJob[playerid]=1;
    }
    else
    {
    SendClientMessage(playerid, 0xFFAAFF,"Müllmission beendet!");
    MuellJob[playerid]=0;
    }
    }
    else
    {
    SendClientMessage(playerid, 0xFFAAFF,"Du bist in keinem Müllwagen!");
    }
    return 1;
    }



    Hinweis: Keinen Kontakt über TeamViewer oder Skype !
    Grüßt den Fehlerklärbär von mir.
    Coming soon: Pawn-Café ( Concept-Sharing | Scripting-First-Aid )

  • pwn(72) : error 018: initialization data exceeds declared size // wieder meins genommen lieber Equ ^^
    pwn(1297) : warning 213: tag mismatch <<<<<<<<<<<<<<<<<<<< if(MuellJob[playerid]==1)
    pwn(1302) : warning 213: tag mismatch <<<<<<<<<<<<<<<<<<<< MuellJob[playerid]=1;
    pwn(1307) : warning 213: tag mismatch <<<<<<<<<<<<<<<<<<<< MuellJob[playerid]=0;
    .pwn(1441) : error 033: array must be indexed (variable "MuellCheckpoint")

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Sorry, (ist schon spät) hab mal wieder nen kleinen Dreher drin:



    if (strcmp("/Müllmann", cmdtext, true) == 0)
    {
    if(GetVehicleModel(GetPlayerVehicleID(playerid))==408/*Ist der Trashmaster*/)//Die Abfrage die hier vorher stand, war total sinn los :D
    {
    if(MuellJob[playerid]==false)
    {
    new rand = random(sizeof(MuellCheckpoint));
    SetPlayerCheckpoint(playerid,MuellCheckpoint[rand][0],MuellCheckpoint[rand][1],MuellCheckpoint[rand][2],3);
    SendClientMessage(playerid, 0xFFAAFF,"Müllmission begonnen!");
    MuellJob[playerid]=true;
    }
    else
    {
    SendClientMessage(playerid, 0xFFAAFF,"Müllmission beendet!");
    MuellJob[playerid]=false;
    }
    }
    else
    {
    SendClientMessage(playerid, 0xFFAAFF,"Du bist in keinem Müllwagen!");
    }
    return 1;
    }



    Hinweis: Keinen Kontakt über TeamViewer oder Skype !
    Grüßt den Fehlerklärbär von mir.
    Coming soon: Pawn-Café ( Concept-Sharing | Scripting-First-Aid )

  • bleibt nurnoch
    1440) : error 033: array must be indexed (variable "MuellCheckpoint")


    in Zeile


    public OnPlayerEnterCheckpoint(playerid)
    {
    if(MuellCheckpoint[playerid]==1) //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Diese ^^
    SendClientMessage(playerid,Orange,"Müll abgeholt. Gehalt pro Checkpoint '25$'");
    DisablePlayerCheckpoint(playerid);