/gov und /ticket verbuggt ?

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
  • Hi,
    Ich habe ein Problem mit diesen beiden Befehlen /gov und /ticket.
    Ich habe nichts daran geändert aber sobald ich Ingame den Befehl nutze steht da : Du bist kein Behördler.
    Obwohl ich eine bin :).


    Kann mir vielleicht jemand helfen.


    if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) { SendClientMessage(playerid, COLOR_GREY, " Du bist kein Behördler !"); return 1; } if(PlayerInfo[playerid][pRank] < 5) { SendClientMessage(playerid, COLOR_GREY, " You need to be Rank 5 to be able to use this !"); 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, "USAGE: (/gov)ernment [text]"); return 1; } SendClientMessageToAll(COLOR_WHITE, "|___________ Staatliche Durchsage ___________|"); format(string, sizeof(string), "Officer %s: %s", sendername, result); SendClientMessageToAll(COLOR_DBLUE, string); } return 1; }


    http://pastebin.de/17954



    if(strcmp(cmd, "/ticket", true) == 0) { if(IsPlayerConnected(playerid)) { if(gTeam[playerid] != 2 || IsACop(playerid)) { SendClientMessage(playerid, COLOR_GREY, " Du bist kein Behördler!"); return 1; } if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1) { SendClientMessage(playerid, COLOR_GREY, " You are not on Duty!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /ticket [playerid/PartOfName] [price] [Grund]"); return 1; } giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /ticket [playerid/PartOfName] [price] [Grund]"); return 1; } moneys = strval(tmp); if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, " Ticket Money can't be below 1 or higher then 99999 !"); return 1; } if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if (ProxDetectorS(8.0, playerid, giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); 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: /ticket [playerid/PartOfName] [price] [Grund]"); return 1; } format(string, sizeof(string), "* You gave %s a Ticket costing $%d, reason: %s", giveplayer, moneys, (result)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has given you a Ticket costing $%d, reason: %s", sendername, moneys, (result)); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Type /accept ticket, to accept it."); TicketOffer[giveplayerid] = playerid; TicketMoney[giveplayerid] = moneys; return 1; } else { SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist nicht in deiner Nähe !"); return 1; } } } else { SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist Offline !"); return 1; } } return 1; }


    http://pastebin.de/17955


  • if(strcmp(cmd, "/ticket", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " You are not on Duty!");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /ticket [playerid/PartOfName] [price] [Grund]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /ticket [playerid/PartOfName] [price] [Grund]");
    return 1;
    }
    moneys = strval(tmp);
    if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, " Ticket Money can't be below 1 or higher then 99999 !"); return 1; }
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if (ProxDetectorS(8.0, playerid, giveplayerid))
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    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: /ticket [playerid/PartOfName] [price] [Grund]");
    return 1;
    }
    format(string, sizeof(string), "* You gave %s a Ticket costing $%d, reason: %s", giveplayer, moneys, (result));
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "* Officer %s has given you a Ticket costing $%d, reason: %s", sendername, moneys, (result));
    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Type /accept ticket, to accept it.");
    TicketOffer[giveplayerid] = playerid;
    TicketMoney[giveplayerid] = moneys;
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist nicht in deiner Nähe !");
    return 1;
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist Offline !");
    return 1;
    }
    }
    return 1;
    }


    if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist kein Behördler !");
    return 1;
    }
    if(PlayerInfo[playerid][pRank] < 5)
    {
    SendClientMessage(playerid, COLOR_GREY, " You need to be Rank 5 to be able to use this !");
    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, "USAGE: (/gov)ernment [text]");
    return 1;
    }
    SendClientMessageToAll(COLOR_WHITE, "|___________ Staatliche Durchsage ___________|");
    format(string, sizeof(string), "Officer %s: %s", sendername, result);
    SendClientMessageToAll(COLOR_DBLUE, string);
    }
    return 1;
    }



    so sollte es gehen