Wieso kann ich nicht /aduty gehen?

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 Breadfish,


    ich habe das Problem, dass wenn ich versuche /aduty zu gehen immer gesagt bekomme, dass ich den Befehl nicht nutzen kann. Was habe ich falsche gescriptet?



    if(strcmp(cmd, "/aduty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pADuty] == 0)
    {
    if(PlayerInfo[playerid][pAdmin] == 1)
    {
    SetPlayerColor(playerid, 0xFF00EBFF);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst begonnen.", sendername);
    OOCNews(0xFF00F5FF,string);
    ProbeSupporter[playerid] = Create3DTextLabel("ProbeSupporter",0xC8C8C8FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(ProbeSupporter[playerid], playerid, 0.0, 0.0, 0.3);
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s started Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,month,day,year,hour,minute);
    AdminLog(string);
    PlayerInfo[playerid][pADuty] = 1;
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SetPlayerSkin(playerid, 279);
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] == 2)
    {
    SetPlayerColor(playerid, 0xFF00EBFF);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst begonnen.", sendername);
    OOCNews(0xFF00F5FF,string);
    Supporter[playerid] = Create3DTextLabel("Supporter",0xF5FF00FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Supporter[playerid], playerid, 0.0, 0.0, 0.3);
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s started Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,month,day,year,hour,minute);
    AdminLog(string);
    PlayerInfo[playerid][pADuty] = 1;
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SetPlayerSkin(playerid, 279);
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] == 3)
    {
    SetPlayerColor(playerid, 0xFF00EBFF);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst begonnen.", sendername);
    OOCNews(0xFF00F5FF,string);
    Moderator[playerid] = Create3DTextLabel("Moderator",0x00FF1EFF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Moderator[playerid], playerid, 0.0, 0.0, 0.3);
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s started Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,month,day,year,hour,minute);
    AdminLog(string);
    PlayerInfo[playerid][pADuty] = 1;
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SetPlayerSkin(playerid, 279);
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] == 4)
    {
    SetPlayerColor(playerid, 0xFF00EBFF);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst begonnen.", sendername);
    OOCNews(0xFF00F5FF,string);
    Administrator[playerid] = Create3DTextLabel("Administrator",0x0073FFFF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Administrator[playerid], playerid, 0.0, 0.0, 0.3);
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s started Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,month,day,year,hour,minute);
    AdminLog(string);
    PlayerInfo[playerid][pADuty] = 1;
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SetPlayerSkin(playerid, 279);
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] == 5)
    {
    SetPlayerColor(playerid, 0xFF00EBFF);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst begonnen.", sendername);
    OOCNews(0xFF00F5FF,string);
    SuperAdministrator[playerid] = Create3DTextLabel("SuperAdministrator",0xFF9600FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(SuperAdministrator[playerid], playerid, 0.0, 0.0, 0.3);
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s started Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,month,day,year,hour,minute);
    AdminLog(string);
    PlayerInfo[playerid][pADuty] = 1;
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SetPlayerSkin(playerid, 279);
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] == 1337)
    {
    SetPlayerColor(playerid, 0xFF00EBFF);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst begonnen.", sendername);
    OOCNews(0xFF00F5FF,string);
    ServerManager[playerid] = Create3DTextLabel("ServerManager",0x0023FFFF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(ServerManager[playerid], playerid, 0.0, 0.0, 0.3);
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s started Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,month,day,year,hour,minute);
    AdminLog(string);
    PlayerInfo[playerid][pADuty] = 1;
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SetPlayerSkin(playerid, 279);
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] == 133
    {
    SetPlayerColor(playerid, 0xFF00EBFF);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst begonnen.", sendername);
    OOCNews(0xFF00F5FF,string);
    ServerOwner[playerid] = Create3DTextLabel("ServerOwner",0xC30000FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(ServerOwner[playerid], playerid, 0.0, 0.0, 0.3);
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s started Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,month,day,year,hour,minute);
    AdminLog(string);
    PlayerInfo[playerid][pADuty] = 1;
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SetPlayerSkin(playerid, 279);
    return 1;
    }
    else
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst beendet.", sendername);
    OOCNews(0xFF00F5FF,string);
    SetPlayerToTeamColor(playerid);
    PlayerInfo[playerid][pADuty] = 0;
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s (lvl %d) stopped Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,PlayerInfo[playerid][pAdmin],month,day,year,hour,minute);
    AdminLog(string);
    SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pModel]);
    Delete3DTextLabel(ProbeSupporter[playerid]);
    Delete3DTextLabel(Supporter[playerid]);
    Delete3DTextLabel(Moderator[playerid]);
    Delete3DTextLabel(Administrator[playerid]);
    Delete3DTextLabel(SuperAdministrator[playerid]);
    Delete3DTextLabel(ServerManager[playerid]);
    Delete3DTextLabel(ServerOwner[playerid]);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du bist nicht berechtigt, diesen Befehl zu benutzen !");
    return 1;
    }
    }
    return 1;
    }



    Danke schonmal im vorraus.

  • Ist ja viel zu unübersichtlich...
    Ich habs mal etwas übersichtlicher gemacht.


    //EDIT
    So...

    //
    if(strcmp(cmd, "/aduty", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] == 0)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du bist nicht berechtigt, diesen Befehl zu benutzen !");
    return 1;
    }
    if(PlayerInfo[playerid][pADuty] == 0)
    {
    SetPlayerColor(playerid, 0xFF00EBFF);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst begonnen.", sendername);
    OOCNews(0xFF00F5FF,string);
    if(PlayerInfo[playerid][pAdmin] == 1)
    {
    ProbeSupporter[playerid] = Create3DTextLabel("ProbeSupporter",0xC8C8C8FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(ProbeSupporter[playerid], playerid, 0.0, 0.0, 0.3);
    }
    if(PlayerInfo[playerid][pAdmin] == 2)
    {
    Supporter[playerid] = Create3DTextLabel("Supporter",0xF5FF00FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Supporter[playerid], playerid, 0.0, 0.0, 0.3);
    }
    if(PlayerInfo[playerid][pAdmin] == 3)
    {
    Moderator[playerid] = Create3DTextLabel("Moderator",0x00FF1EFF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Moderator[playerid], playerid, 0.0, 0.0, 0.3);
    }
    if(PlayerInfo[playerid][pAdmin] == 4)
    {
    Administrator[playerid] = Create3DTextLabel("Administrator",0x0073FFFF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Administrator[playerid], playerid, 0.0, 0.0, 0.3);
    }
    if(PlayerInfo[playerid][pAdmin] == 5)
    {
    SuperAdministrator[playerid] = Create3DTextLabel("SuperAdministrator",0xFF9600FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(SuperAdministrator[playerid], playerid, 0.0, 0.0, 0.3);
    }
    if(PlayerInfo[playerid][pAdmin] == 1337)
    {
    ServerManager[playerid] = Create3DTextLabel("ServerManager",0x0023FFFF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(ServerManager[playerid], playerid, 0.0, 0.0, 0.3);
    }
    if(PlayerInfo[playerid][pAdmin] == 1338)
    {
    ServerOwner[playerid] = Create3DTextLabel("ServerOwner",0xC30000FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(ServerOwner[playerid], playerid, 0.0, 0.0, 0.3);
    }
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s started Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,month,day,year,hour,minute);
    AdminLog(string);
    PlayerInfo[playerid][pADuty] = 1;
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SetPlayerSkin(playerid, 279);
    return 1;
    }
    else
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "AdmCmd: Admin %s hat den Admindienst beendet.", sendername);
    OOCNews(0xFF00F5FF,string);
    SetPlayerToTeamColor(playerid);
    PlayerInfo[playerid][pADuty] = 0;
    getdate(year, month, day);
    gettime(hour, minute);
    format(string, sizeof(string), "AdmCmd: Admin %s (lvl %d) stopped Support as an Admin. (%d-%d-%d)(%d:%d Uhr)", sendername,PlayerInfo[playerid][pAdmin],month,day,year,hour,minute);
    AdminLog(string);
    SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pModel]);
    Delete3DTextLabel(ProbeSupporter[playerid]);
    Delete3DTextLabel(Supporter[playerid]);
    Delete3DTextLabel(Moderator[playerid]);
    Delete3DTextLabel(Administrator[playerid]);
    Delete3DTextLabel(SuperAdministrator[playerid]);
    Delete3DTextLabel(ServerManager[playerid]);
    Delete3DTextLabel(ServerOwner[playerid]);
    return 1;
    }
    return 1;
    }
    //restlichen befehle