string 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
  • Hallo ihr Brotfische ;)


    Ich hab ein string fehler beim /wanted...
    Also hier die Zeile:
    if(strcmp(cmdtext, "/wanted", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new giveplayer[MAX_PLAYER_NAME];
    if(SpielerInfo[playerid][Fraktion] == 1 && OnDuty[playerid] == 1)
    {
    new x12;
    SendClientMessage(playerid, COLOR_GREEN, "Gesuchte Verbrecher:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][Wanteds] >= 1)
    {
    new string[50];
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s%s: %d", string,giveplayer,SpielerInfo[i][Wanteds]);
    x12++;
    if(x12 > 1) {
    SendClientMessage(playerid, COLOR_YELLOW, string);
    x12 = 0;
    format(string, sizeof(string), "");
    } else {
    format(string, sizeof(string), "%s, ", string);
    }
    }
    }
    }
    if(x12 <= 3 && x12 > 0) {
    string[strlen(string)-2] = '.'; //HIER SIND DIE ERRORS
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "Du bist kein Polizist oder nicht im Dienst!");
    }
    }//not connected
    return 1;
    }
    Hier die Errors:
    C:\Users\Mehmet Ali\Desktop\Selfmade by RedFly\gamemodes\[GSL]RealLife.pwn(19351) : error 017: undefined symbol "string"
    C:\Users\Mehmet Ali\Desktop\Selfmade by RedFly\gamemodes\[GSL]RealLife.pwn(19351) : error 017: undefined symbol "string"
    C:\Users\Mehmet Ali\Desktop\Selfmade by RedFly\gamemodes\[GSL]RealLife.pwn(19351) : error 029: invalid expression, assumed zero
    C:\Users\Mehmet Ali\Desktop\Selfmade by RedFly\gamemodes\[GSL]RealLife.pwn(19351) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.


    Galaxy RealLife

    Server Owner

  • if(strcmp(cmdtext, "/bl", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new giveplayer[MAX_PLAYER_NAME];
    if(SpielerInfo[playerid][Fraktion] == 2)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Blacklist:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][BlacklistGrove] == 1)
    {
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s",giveplayer); //HIER
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    }
    }


    EDIT: Also wenn ich das mache kommt aufeinmal diese Zeile wieso :(


    Galaxy RealLife

    Server Owner

  • if(strcmp(cmdtext, "/bl", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new giveplayer[MAX_PLAYER_NAME];
    if(SpielerInfo[playerid][Fraktion] == 2)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Blacklist:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][BlacklistGrove] == 1)
    {
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s",giveplayer); //HIER
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    }
    }


    Also wenn ich das mache kommt aufeinmal diese Zeile wieso :(


    Galaxy RealLife

    Server Owner

  • ehmm hier das ganze Befehl
    if(strcmp(cmdtext, "/bl", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new giveplayer[MAX_PLAYER_NAME];
    if(SpielerInfo[playerid][Fraktion] == 2)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Blacklist:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][BlacklistGrove] == 1)
    {
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s",giveplayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    }
    }
    if(SpielerInfo[playerid][Fraktion] == 3)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Blacklist:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][BlacklistBallas] == 1)
    {
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s",giveplayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    }
    }
    if(SpielerInfo[playerid][Fraktion] == 4)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Blacklist:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][BlacklistBlack] == 1)
    {
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s",giveplayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    }
    }
    if(SpielerInfo[playerid][Fraktion] == 5)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Blacklist:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][BlacklistBast] == 1)
    {
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s",giveplayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    }
    }
    if(SpielerInfo[playerid][Fraktion] == 10)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Blacklist:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][BlacklistYakuza] == 1)
    {
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s",giveplayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    }
    }
    if(SpielerInfo[playerid][Fraktion] == 12)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Blacklist:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][BlacklistScarfo] == 1)
    {
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s",giveplayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    }
    }
    if(SpielerInfo[playerid][Fraktion] == 13)
    {
    SendClientMessage(playerid, COLOR_GREEN, "Blacklist:");
    for(new i=0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i))
    {
    if(SpielerInfo[i][BlacklistLS13] == 1)
    {
    GetPlayerName(i, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "%s",giveplayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "Du bist dafür nicht befugt!");
    }
    }//not connected
    return 1;
    }


    Galaxy RealLife

    Server Owner