Probleme mit Checkpoints

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
  • Hey Leute, Ich habe versucht mit dem Wiki und dem Müllabfuhr script mal einen kleinen Job zubasteln zum üben, bin jedoch an den Errors gescheitert..


    Command

    if(strcmp("/BauernJob", cmdtext, true, 10) == 0)
    {
    BCP[playerid] = 1;
    SpielerInfo[playerid][Job] = 1; // Bauer
    SetPlayerCheckpoint(playerid, -21.7644,-34.9566,3.1172,3.0);
    return 1;
    }


    OnPlayerEnterCheckpoint



    public OnPlayerEnterCheckpoint(playerid)
    {
    BCP[playerid] ++;
    if(BCP[playerid] == 1)
    {
    DisablePlayerCheckpoint(playerid);
    GivePlayerMoney(playerid, 10);
    SetPlayerCheckpoint(playerid, 28.2644,-85.4687,1.0968, 3.0);
    BCP[playerid] = 2;
    }
    else if(BCP[playerid] == 2)
    {
    DisablePlayerCheckpoint(playerid);
    GivePlayerMoney(playerid, 10);
    SetPlayerCheckpoint(playerid, 23.0916,60.7290,3.1172, 3.0);
    BCP[playerid] = 3;
    }
    else if(BCP[playerid] == 3)
    {
    DisablePlayerCheckpoint(playerid);
    GivePlayerMoney(playerid, 10);
    SetPlayerCheckpoint(playerid, 20.5995,52.0560,3.1172, 3.0);
    BCP[playerid] = 4;
    }
    else if(BCP[playerid] == 4)
    {
    DisablePlayerCheckpoint(playerid);
    GivePlayerMoney(playerid, 10);
    SetPlayerCheckpoint(playerid, 17.4598,41.1289,3.1172 3.0);
    BCP[playerid] = 5;
    }
    return 1;
    }


    Errors

    C:\SAMPSERVER\pawno\login_register.pwn(161) : error 017: undefined symbol "BCP"
    C:\SAMPSERVER\pawno\login_register.pwn(161) : warning 215: expression has no effect
    C:\SAMPSERVER\pawno\login_register.pwn(161) : error 001: expected token: ";", but found "]"
    C:\SAMPSERVER\pawno\login_register.pwn(161) : error 029: invalid expression, assumed zero
    C:\SAMPSERVER\pawno\login_register.pwn(161) : fatal error 107: too many error messages on one line


    [b]Zeile 161 -> BCP[playerid] = 1;[/b]


    Hoffe jemand kann mir helfen weil Ich weiß echt nichtmehr weiter :love:

  • Gemacht,


    Errors:



    C:\SAMPSERVER\pawno\login_register.pwn(69) : warning 202: number of arguments does not match definition
    C:\SAMPSERVER\pawno\login_register.pwn(162) : warning 215: expression has no effect
    C:\SAMPSERVER\pawno\login_register.pwn(303) : error 001: expected token: ",", but found "-rational value-"
    C:\SAMPSERVER\pawno\login_register.pwn(303) : warning 215: expression has no effect
    C:\SAMPSERVER\pawno\login_register.pwn(303) : error 001: expected token: ";", but found ")"
    C:\SAMPSERVER\pawno\login_register.pwn(303) : error 029: invalid expression, assumed zero
    C:\SAMPSERVER\pawno\login_register.pwn(303) : fatal error 107: too many error messages on one line

  • new BCP[MAX_PLAYERS];



    if(strcmp("/BauernJob", cmdtext, true, 10) == 0)
    {
    BCP[playerid] = 1;
    SpielerInfo[playerid][Job] = 1; // Bauer
    SetPlayerCheckpoint(playerid, -21.7644,-34.9566,3.1172,3.0);
    return 1;
    }


    public OnPlayerEnterCheckpoint(playerid)
    {
    if(BCP[playerid] == 1)
    {
    DisablePlayerCheckpoint(playerid);
    GivePlayerMoney(playerid, 10);
    SetPlayerCheckpoint(playerid, 28.2644,-85.4687,1.0968, 3.0);
    BCP[playerid] = 2;
    }
    else if(BCP[playerid] == 2)
    {
    DisablePlayerCheckpoint(playerid);
    GivePlayerMoney(playerid, 10);
    SetPlayerCheckpoint(playerid, 23.0916,60.7290,3.1172, 3.0);
    BCP[playerid] = 3;
    }
    else if(BCP[playerid] == 3)
    {
    DisablePlayerCheckpoint(playerid);
    GivePlayerMoney(playerid, 10);
    SetPlayerCheckpoint(playerid, 20.5995,52.0560,3.1172, 3.0);
    BCP[playerid] = 4;
    }
    else if(BCP[playerid] == 4)
    {
    DisablePlayerCheckpoint(playerid);
    GivePlayerMoney(playerid, 10);
    SetPlayerCheckpoint(playerid, 17.4598,41.1289,3.1172, 3.0);
    BCP[playerid] = 0;
    }
    return 1;
    }



    Das sollte Funktionieren