/aduty unbesiegbar

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
  • Ich würd einfach bei /aduty SetPlayerHealth(playerid, 1000); machen und bei OnPlayerTakeDamage Abfragen ob er im Admindienst ist und wieder das Leben auf 1000 setzen.


    public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
    {
    if(issuerid != INVALID_PLAYER_ID && PlayerInfo[playerid]Aduty == 1) //Durch deine Abfrage ob der Spieler im Admindienst ist ersetzen
    {
    SetPlayerHealth(playerid, 1000);
    }
    return 1;
    }

  • Abfrage erstellen, ob der Spieler im Admin Dienst ist...
    new Float:hp;
    GetPlayerHealth(playerid,hp);
    SetPlayerHealth(playerid,hp);


    Pablo so wie du es sagst. Wenn er bsp. in dem moment mit 50hp rum läuft dann setzt er das leben wieder auf 50hp


    Guter Support, Gute Preise! Freunde das ist kein Speed das ist Lichtgeschwindigkeit!
    Atrox Devolpment[/size]
    [size=24][color=#ff0000]Kunde | Top WBB Produkte

  • So hier :thumbup:


    if(strcmp(cmd, "/adminduty", true)==0 || strcmp(cmd, "/aod", true)==0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du musst eingeloggt sein !");
    return 1;
    }
    if(SpielerInfo[playerid][pAdmin] == 1)
    {
    if(AdminDuty[playerid] == 0)
    {
    AdminDuty[playerid] = 1;
    SetPlayerArmour(playerid, 999);
    SetPlayerHealth(playerid, 999);
    SetPlayerColor(playerid, COLOR_GREEN); //Grün
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin On Duty",sendername,playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPVarInt(playerid, "AdminProtect", 1);
    new GMTEXT1[MAX_PLAYER_NAME];
    if (SpielerInfo[playerid][pSex] == 1)
    GMTEXT1 = "Supporter";
    else if (SpielerInfo[playerid][pSex] == 2)
    GMTEXT1 = "Supporterin";
    ADMIN1[playerid] = Create3DTextLabel(GMTEXT1,0x779529FF,0,0,0,7.0,1);
    Attach3DTextLabelToPlayer(ADMIN1[playerid], playerid, 0.0, 0.0, 0.45);
    return 1;
    }
    else if(AdminDuty[playerid] == 1)
    {
    AdminDuty[playerid] = 0;
    SetPlayerArmour(playerid, 0);
    SetPlayerHealth(playerid, 100);
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin Off Duty",sendername, playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPlayerToTeamColor(playerid); //Normal/Weiss
    SetPVarInt(playerid, "AdminProtect", 0);
    Delete3DTextLabel(ADMIN1[playerid]);
    return 1;
    }
    }
    else if(SpielerInfo[playerid][pAdmin] == 2)
    {
    if(AdminDuty[playerid] == 0)
    {
    AdminDuty[playerid] = 1;
    SetPlayerArmour(playerid, 999);
    SetPlayerHealth(playerid, 999);
    SetPlayerColor(playerid, COLOR_GREEN); //Grün
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin On Duty",sendername,playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPVarInt(playerid, "AdminProtect", 1);
    new GMTEXT2[MAX_PLAYER_NAME];
    if (SpielerInfo[playerid][pSex] == 1)
    GMTEXT2 = "Supporter";
    else if (SpielerInfo[playerid][pSex] == 2)
    GMTEXT2 = "Supporterin";
    ADMIN2[playerid] = Create3DTextLabel(GMTEXT2,0x779529FF,0,0,0,7.0,1);
    Attach3DTextLabelToPlayer(ADMIN2[playerid], playerid, 0.0, 0.0, 0.45);
    return 1;
    }
    else if(AdminDuty[playerid] == 1)
    {
    AdminDuty[playerid] = 0;
    SetPlayerArmour(playerid, 0);
    SetPlayerHealth(playerid, 100);
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin Off Duty",sendername, playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPlayerToTeamColor(playerid); //Normal/Weiss
    SetPVarInt(playerid, "AdminProtect", 0);
    Delete3DTextLabel(ADMIN2[playerid]);
    return 1;
    }
    }
    else if(SpielerInfo[playerid][pAdmin] == 3)
    {
    if(AdminDuty[playerid] == 0)
    {
    AdminDuty[playerid] = 1;
    SetPlayerArmour(playerid, 999);
    SetPlayerHealth(playerid, 999);
    SetPlayerColor(playerid, COLOR_GREEN); //Grün
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin On Duty",sendername,playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPVarInt(playerid, "AdminProtect", 1);
    new GMTEXT3[MAX_PLAYER_NAME];
    if (SpielerInfo[playerid][pSex] == 1)
    GMTEXT3 = "Administrator";
    else if (SpielerInfo[playerid][pSex] == 2)
    GMTEXT3 = "Administratorin";
    ADMIN3[playerid] = Create3DTextLabel(GMTEXT3,0x779529FF,0,0,0,7.0,1);
    Attach3DTextLabelToPlayer(ADMIN3[playerid], playerid, 0.0, 0.0, 0.45);
    return 1;
    }
    else if(AdminDuty[playerid] == 1)
    {
    AdminDuty[playerid] = 0;
    SetPlayerArmour(playerid, 0);
    SetPlayerHealth(playerid, 100);
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin Off Duty",sendername, playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPlayerToTeamColor(playerid); //Normal/Weiss
    SetPVarInt(playerid, "AdminProtect", 0);
    Delete3DTextLabel(ADMIN3[playerid]);
    return 1;
    }
    }
    else if(SpielerInfo[playerid][pAdmin] == 4)
    {
    if(AdminDuty[playerid] == 0)
    {
    AdminDuty[playerid] = 1;
    SetPlayerArmour(playerid, 999);
    SetPlayerHealth(playerid, 999);
    SetPlayerColor(playerid, COLOR_GREEN); //Grün
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin On Duty",sendername,playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPVarInt(playerid, "AdminProtect", 1);
    new GMTEXT4[MAX_PLAYER_NAME];
    if (SpielerInfo[playerid][pSex] == 1)
    GMTEXT4 = "Administrator";
    else if (SpielerInfo[playerid][pSex] == 2)
    GMTEXT4 = "Administratorin";
    ADMIN4[playerid] = Create3DTextLabel(GMTEXT4,0x779529FF,0,0,0,7.0,1);
    Attach3DTextLabelToPlayer(ADMIN4[playerid], playerid, 0.0, 0.0, 0.45);
    return 1;
    }
    else if(AdminDuty[playerid] == 1)
    {
    AdminDuty[playerid] = 0;
    SetPlayerArmour(playerid, 0);
    SetPlayerHealth(playerid, 100);
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin Off Duty",sendername, playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPlayerToTeamColor(playerid); //Normal/Weiss
    SetPVarInt(playerid, "AdminProtect", 0);
    Delete3DTextLabel(ADMIN4[playerid]);
    return 1;
    }
    }
    else if(SpielerInfo[playerid][pAdmin] == 1337)
    {
    if(AdminDuty[playerid] == 0)
    {
    AdminDuty[playerid] = 1;
    SetPlayerArmour(playerid, 999);
    SetPlayerHealth(playerid, 999);
    SetPlayerColor(playerid, COLOR_GREEN); //Grün
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin On Duty",sendername,playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPVarInt(playerid, "AdminProtect", 1);
    new GMTEXT1337[MAX_PLAYER_NAME];
    if (SpielerInfo[playerid][pSex] == 1)
    GMTEXT1337 = "Super Administrator";
    else if (SpielerInfo[playerid][pSex] == 2)
    GMTEXT1337 = "Super Administratorin";
    ADMIN1337[playerid] = Create3DTextLabel(GMTEXT1337,0x46A7BFFF,0,0,0,7.0,1);
    Attach3DTextLabelToPlayer(ADMIN1337[playerid], playerid, 0.0, 0.0, 0.45);
    return 1;
    }
    else if(AdminDuty[playerid] == 1)
    {
    AdminDuty[playerid] = 0;
    SetPlayerArmour(playerid, 0);
    SetPlayerHealth(playerid, 100);
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin Off Duty",sendername, playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPlayerToTeamColor(playerid); //Normal/Weiss
    SetPVarInt(playerid, "AdminProtect", 0);
    Delete3DTextLabel(ADMIN1337[playerid]);
    return 1;
    }
    }
    else if(SpielerInfo[playerid][pAdmin] == 1338)
    {
    if(AdminDuty[playerid] == 0)
    {
    AdminDuty[playerid] = 1;
    SetPlayerArmour(playerid, 999);
    SetPlayerHealth(playerid, 999);
    SetPlayerColor(playerid, COLOR_GREEN); //Grün
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin On Duty",sendername,playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPVarInt(playerid, "AdminProtect", 1);
    new GMTEXT1338[MAX_PLAYER_NAME];
    if (SpielerInfo[playerid][pSex] == 1)
    GMTEXT1338 = "Server Leitung";
    else if (SpielerInfo[playerid][pSex] == 2)
    GMTEXT1338 = "Server Leitung";
    ADMIN1338[playerid] = Create3DTextLabel(GMTEXT1338,0xC3BE0EFF,0,0,0,7.0,1);
    Attach3DTextLabelToPlayer(ADMIN1338[playerid], playerid, 0.0, 0.0, 0.45);
    return 1;
    }
    else if(AdminDuty[playerid] == 1)
    {
    AdminDuty[playerid] = 0;
    SetPlayerArmour(playerid, 0);
    SetPlayerHealth(playerid, 100);
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s[ID:%d] geht als Admin Off Duty",sendername, playerid);
    SendClientMessageToAll(COLOR_GREEN,string);
    SetPlayerToTeamColor(playerid); //Normal/Weiss
    SetPVarInt(playerid, "AdminProtect", 0);
    Delete3DTextLabel(ADMIN1338[playerid]);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, "Du bist kein Administrator!");
    return 1;
    }
    }
    return 1;
    }