A-Chat können alle lesen

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,



    ich hab folgendes proplem und zwar können den a chat alle lesen


    Ich weiß nicht warum !


    Hier ist der Befehlif(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (SpielerInfo[playerid][pAdmin] >= 3)
    {
    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_RED, "FEHLER: (/a)dmin [admin chat]");
    return 1;
    }
    format(string, sizeof(string), "** %s: %s", sendername, result);
    if (SpielerInfo[playerid][pAdmin] >= 1)
    {
    SendAdminMessage(0xFFBE00FF, string);
    }
    printf("Admin %s: %s", sendername, result);
    } else {
    SendClientMessage(playerid, COLOR_GRAD1, " Du darfst diesen Befehl nicht benutzen !");
    }
    }
    return 1;
    }



    Ich hoffe mir kann jemand helfen


  • Function SendAdminMessage(color, string[])
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pAdmin] >= 1)
    {
    SendClientMessage(i, color, string);
    }
    }
    }
    }


  • habs jetzt mal aus dem GF gezogen :


    Function SendAdminMessage(color, string[])
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pAdmin] >= 1)
    {
    SendClientMessage(i, color, string);
    }
    }
    }
    }
    Und der A Chat
    if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    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, "NUTZE: (/a)dmin [admin chat]");
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
    format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
    }
    else if(PlayerInfo[playerid][pSupporter] >= 1)
    {
    format(string, sizeof(string), "*%d Supporter %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
    }
    else if(PlayerInfo[playerid][pSupporter] == 6)
    {
    format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
    }


    else return 1;
    for(new i=0; i<GetMaxPlayers(); i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pSupporter] >= 1 || PlayerInfo[i][pAdmin] >= 1)
    {
    SendClientMessage(i,COLOR_YELLOW,string);
    }
    }
    }
    Log("OA-Chat.txt",string);
    }
    return 1;
    }

  • C:\Users\Tim\Desktop\Döner\gamemodes\Döner.pwn(268) : warning 201: redefinition of constant/macro (symbol "DIALOG_AFKLIST")
    C:\Users\Tim\Desktop\WestSideRL\gamemodes\Döner.pwn(10008) : warning 204: symbol is assigned a value that is never used: "vName"
    C:\Users\Tim\Desktop\WestSideRL\gamemodes\Döner.pwn(15717) : warning 216: nested comment
    C:\Users\Tim\Desktop\WestSideRL\gamemodes\Döner.pwn(24884) : warning 204: symbol is assigned a value that is never used: "tmp2"
    C:\Users\Tim\Desktop\WestSideRL\gamemodes\Döner.pwn(25670) : error 017: undefined symbol "SpielerInfo"
    C:\Users\Tim\Desktop\WestSideRL\gamemodes\Döner.pwn(25670) : warning 215: expression has no effect
    C:\Users\Tim\Desktop\WestSideRL\gamemodes\Döner.pwn(25670) : error 001: expected token: ";", but found "]"
    C:\Users\Tim\Desktop\WestSideRL\gamemodes\Döner.pwn(25670) : error 029: invalid expression, assumed zero
    C:\Users\Tim\Desktop\WestSideRL\gamemodes\Döner.pwn(25670) : 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.