Buslinien in OnPlayerEnterChekpoint

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
  • Guten Morgen



    Mein Problem ist nun wie folgt:


    Beim Compailen ist mir aufgefallen das Folgende error meldungen kommen:
    samplernen.p(1200) : error 029: invalid expression, assumed zero
    samplernen.p(1200) : warning 215: expression has no effect
    samplernen.p(1200) : error 001: expected token: ";", but found "if"


    Das bezieht sich auf die 4 Buslinie!!




    public OnPlayerEnterCheckpoint(playerid)
    {
    if(GetPVarInt(playerid, "trash_job"))
    {
    //Wenn trash job ausgeführt wird
    new cID = GetPVarInt(playerid, "trash_cp");
    if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
    {
    cID++;

    if(cID >= sizeof(tCPs))
    {
    GivePlayerMoney(playerid, 3000);
    SetPVarInt(playerid, "trash_cp", 0);
    SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
    SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid, "trash_cp", cID);
    SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
    }
    return 1;
    }
    }

    if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,5,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }

    else if(GetPVarInt(playerid,"bus_job") == 2)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,5,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
    {
    bID++;
    if(bID >= sizeof(bust2cps))
    {
    GivePlayerMoney(playerid,12000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
    }
    }
    else if (GetPVarInt(playerid,"bus_job") == 3)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
    {
    bID++;
    if(bID >= sizeof(bust3cps))
    {
    GivePlayerMoney(playerid,15000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    }
    else if (GetPVarInt(playerid,"bus_job") == 4)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
    {
    bID++;
    if(bID >= sizeof(bust4cps))
    {
    GivePlayerMoney(playerid,30000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    }
    }
    }
    }
    }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
    }



    Ich hoffe man kann mir helfen da ich den fehler einfach nicht finde











    ps: Fehler gefunden:
    Bei den vorherigen Code:
    pwn]samplernen.p(1200) : error 029: invalid expression, assumed zero
    samplernen.p(1200) : warning 215: expression has no effect
    samplernen.p(1200) : error 001: expected token: ";", but found "if"


    Das bezieht sich auf die 4 Buslinie!!




    public OnPlayerEnterCheckpoint(playerid)
    {
    if(GetPVarInt(playerid, "trash_job"))
    {
    //Wenn trash job ausgeführt wird
    new cID = GetPVarInt(playerid, "trash_cp");
    if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
    {
    cID++;

    if(cID >= sizeof(tCPs))
    {
    GivePlayerMoney(playerid, 3000);
    SetPVarInt(playerid, "trash_cp", 0);
    SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
    SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid, "trash_cp", cID);
    SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
    }
    return 1;
    }
    }

    if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,5,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }

    else if(GetPVarInt(playerid,"bus_job") == 2)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,5,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
    {
    bID++;
    if(bID >= sizeof(bust2cps))
    {
    GivePlayerMoney(playerid,12000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
    }
    }
    else if (GetPVarInt(playerid,"bus_job") == 3)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
    {
    bID++;
    if(bID >= sizeof(bust3cps))
    {
    GivePlayerMoney(playerid,15000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    }
    else if (GetPVarInt(playerid,"bus_job") == 4)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
    {
    bID++;
    if(bID >= sizeof(bust4cps))
    {
    GivePlayerMoney(playerid,30000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    }
    }
    }
    }
    }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
    }


    war das letze } über DisablePlayerCheckpoint(playerid);
    falsch gesetzt was ich nun entfert habe und funktioniert hat.



    So sieht es jetzt aus:
    public OnPlayerEnterCheckpoint(playerid)
    {
    if(GetPVarInt(playerid, "trash_job"))
    {
    //Wenn trash job ausgeführt wird
    new cID = GetPVarInt(playerid, "trash_cp");
    if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
    {
    cID++;

    if(cID >= sizeof(tCPs))
    {
    GivePlayerMoney(playerid, 3000);
    SetPVarInt(playerid, "trash_cp", 0);
    SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
    SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid, "trash_cp", cID);
    SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
    }
    return 1;
    }
    }

    if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,5,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }

    else if(GetPVarInt(playerid,"bus_job") == 2)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,5,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
    {
    bID++;
    if(bID >= sizeof(bust2cps))
    {
    GivePlayerMoney(playerid,12000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
    }
    }
    else if (GetPVarInt(playerid,"bus_job") == 3)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
    {
    bID++;
    if(bID >= sizeof(bust3cps))
    {
    GivePlayerMoney(playerid,15000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    }
    }
    else if(GetPVarInt(playerid,"bus_job") == 4)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
    {
    bID++;
    if(bID >= sizeof(bust4cps))
    {
    GivePlayerMoney(playerid,30000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    }

    }
    }
    }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
    }




    ps:


    Checkpoints werden nicht gezeigt