Hilfe bei /a /admin

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 Liebes Breadfish also ich wollte fragen wie User auch in den Admin chat schreib können!



    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,0xE10000FF,string);
    }
    }
    }
    Log("OA-Chat.txt",string);
    }
    return 1;
    }

  • so also so ?


    if(PlayerInfo[playerid][playerid] >= 1)
    {
    format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
    }
    else if(PlayerInfo[playerid][playerid] >= 1)
    {
    format(string, sizeof(string), "*%d Supporter %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
    }
    else if(PlayerInfo[playerid][playerid] == 6)
    {
    format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
    }

  • if(PlayerInfo[playerid][playerid] >= 1)
    {
    format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
    }


    so:
    format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, resul]t);

  • C:\Users\suleyman\Desktop\German Sun RolePlay\gamemodes\GSR.pwn(31621) : error 017: undefined symbol "resul"
    C:\Users\suleyman\Desktop\German Sun RolePlay\gamemodes\GSR.pwn(31621) : error 029: invalid expression, assumed zero
    C:\Users\suleyman\Desktop\German Sun RolePlay\gamemodes\GSR.pwn(31621) : error 017: undefined symbol "t"
    C:\Users\suleyman\Desktop\German Sun RolePlay\gamemodes\GSR.pwn(31621) : fatal error 107: too many error messages on one line

  • 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][pAdmin], sendername, playerid, result);
    }

  • 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][pAdmin], sendername, playerid, result);
    }
    Du hast die Abfrage nicht entfernt. Mach es so:


    format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
    //die anderen Sachen auch weg

  • 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;
    }
    format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
    for(new i=0; i<GetMaxPlayers(); i++)
    {
    if(IsPlayerConnected(i))
    {
    SendClientMessage(i,0xE10000FF,string);
    }
    }
    Log("OA-Chat.txt",string);
    }
    return 1;
    }