[HILFE]/gov Fehler

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
  • Wieder mal ich ^^
    Habe mal eine frage unzwar habe ich errors bei /gov wenn ich ARMY einfügen möchte.


    ...GhosT.pwn(14664) : error 029: invalid expression, assumed zero
    ...GhosT.pwn(14664) : warning 215: expression has no effect
    ...GhosT.pwn(14664) : error 001: expected token: ";", but found ")"
    ...GhosT.pwn(14664) : error 029: invalid expression, assumed zero


    Die Zeile ist diese


    if(gTeam[playerid] != 2) || gTeam[playerid] != 3)


    Und die Funktion dies ^^


    if(strcmp(cmd, "/gov", true) == 0 || strcmp(cmd, "/reg", true) == 0)
    {
    new rankname[64];
    if(IsPlayerConnected(playerid))
    {
    if(gTeam[playerid] != 2) || gTeam[playerid] != 3)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist kein Beamter !");
    return 1;
    }
    if(PlayerInfo[playerid][pRank] < 6)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du brauchst Rang 6 !");
    return 1;
    }
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /gov [text]");
    return 1;
    }
    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
    {
    if(PlayerInfo[playerid][pRank] == 6) { rankname = "Polizeihauptkommissar"; }
    else if(PlayerInfo[playerid][pRank] == 7) { rankname = "Erster Polizeihauptkommissar"; }
    else if(PlayerInfo[playerid][pRank] == 8) { rankname = "Polizeirat"; }
    else if(PlayerInfo[playerid][pRank] == 9) { rankname = "Polizeioberrat"; }
    else if(PlayerInfo[playerid][pRank] == 10) { rankname = "Polizeidirektor"; }
    else if(PlayerInfo[playerid][pRank] == 11) { rankname = "Leitender Polizeidirektor"; }
    else if(PlayerInfo[playerid][pRank] == 12) { rankname = "Polizeipräsident"; }
    else { rankname = "Polizeihauptkommissar"; }
    }
    if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
    {
    if(PlayerInfo[playerid][pRank] == 6) { rankname = "Undercover Agent"; }
    else if(PlayerInfo[playerid][pRank] == 7) { rankname = "Assistant Special Agent"; }
    else if(PlayerInfo[playerid][pRank] == 8) { rankname = "S.W.A.T"; }
    else if(PlayerInfo[playerid][pRank] == 9) { rankname = "Specialist"; }
    else if(PlayerInfo[playerid][pRank] == 10) { rankname = "S.W.A.T Ausbilder"; }
    else if(PlayerInfo[playerid][pRank] == 11) { rankname = "Stellv. Department Direktor"; }
    else if(PlayerInfo[playerid][pRank] == 12) { rankname = "Department Director"; }
    else { rankname = "Undercover Agent"; }
    }
    if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3)
    {
    if(PlayerInfo[playerid][pRank] == 6) { rankname = "Staff Sergeant"; }
    else if(PlayerInfo[playerid][pRank] == 7) { rankname = "Sergeant first class"; }
    else if(PlayerInfo[playerid][pRank] == 8) { rankname = "Master sergeant"; }
    else if(PlayerInfo[playerid][pRank] == 9) { rankname = "Sergeant major"; }
    else if(PlayerInfo[playerid][pRank] == 10) { rankname = "first sergeant"; }
    else if(PlayerInfo[playerid][pRank] == 11) { rankname = "Command sgt Major"; }
    else if(PlayerInfo[playerid][pRank] == 12) { rankname = "Segeant Major of the Army"; }
    else { rankname = "Staff Sergeant"; }
    }


    SendClientMessageToAll(COLOR_WHITE, "....:::: Regierungs-Nachricht ::::....");
    format(string, sizeof(string), "%s %s: %s", rankname,sendername, result);
    SendClientMessageToAll(COLOR_DBLUE, string);
    }
    return 1;
    }


    Danke im Vorraus
    :thumbup:
    sry wegen soviele fragen ist nunmal notwendig

  • Das hier :
    if(gTeam[playerid] != 2) || gTeam[playerid] != 3)


    durch das hier ersetzten :
    if(gTeam[playerid] != 2 || gTeam[playerid] != 3)


    Nicht jeder, der sich für super hält, ist ein Superheld. :love:
    ------------------------------------------------------------------------------------------------