/heal frage

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

  • ocmd:heal(playerid)
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,255.0789,77.4782,1003.6406) || IsPlayerInRangeOfPoint(playerid,4.0,197.8206,168.2515,1003.0234) || IsPlayerInRangeOfPoint(playerid,4.0,225.0941,121.8315,999.0803))
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    return 1;
    }
    return 1;
    }



    Hay wie kann ich einfügen das der befehl auslest wen der Spieler in der Gang/Mafia ist das er 100 HP bekommt wen er an einem gewissen punkt ist ?? und /heal eingibt

  • ocmd:heal(playerid)
    {
    if(SpielerInfo[playerid][Gang] == GANG_MAFIA)
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,255.0789,77.4782,1003.6406) || IsPlayerInRangeOfPoint(playerid,4.0,197.8206,168.2515,1003.0234) || IsPlayerInRangeOfPoint(playerid,4.0,225.0941,121.8315,999.0803))
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    }
    }
    return 1;
    }
    Die Variable in der Abfrage musst du natürlich entsprechend deinem System anpassen.


  • ocmd:heal(playerid)
    {
    if(IsPlayerInFrac(playerid,1) || IsPlayerInFrac(playerid,2) || IsPlayerInFrac(playerid,3))
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,255.0789,77.4782,1003.6406) || IsPlayerInRangeOfPoint(playerid,4.0,197.8206,168.2515,1003.0234) || IsPlayerInRangeOfPoint(playerid,4.0,225.0941,121.8315,999.0803))
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    }
    }
    return 1;
    }


    Meine eine Trennung das ist der befehl jetzt nur für die Staats Mitglieder das man das noch einbaut mit gang?

  • ocmd:heal(playerid)
    {
    if(IsPlayerInFrac(playerid,1) || IsPlayerInFrac(playerid,2) || IsPlayerInFrac(playerid,3))
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,255.0789,77.4782,1003.6406) || IsPlayerInRangeOfPoint(playerid,4.0,197.8206,168.2515,1003.0234) || IsPlayerInRangeOfPoint(playerid,4.0,225.0941,121.8315,999.0803))
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    }
    }
    else if(IsPlayerInFrac(playerid,ANDERE_ID))
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,WOANDERS_KOORDINATEN))
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    }
    }
    return 1;
    }


  • ocmd:heal(playerid)
    {
    if(IsPlayerInFrac(playerid,1) || IsPlayerInFrac(playerid,2) || IsPlayerInFrac(playerid,3))
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,255.0789,77.4782,1003.6406) || IsPlayerInRangeOfPoint(playerid,4.0,197.8206,168.2515,1003.0234) || IsPlayerInRangeOfPoint(playerid,4.0,225.0941,121.8315,999.0803))
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    }
    }
    else if(IsPlayerInFrac(playerid,6) || IsPlayerInFrac(playerid,7) || IsPlayerInFrac(playerid,8) || IsPlayerInFrac(playerid,9) || IsPlayerInFrac(playerid,13) || IsPlayerInFrac(playerid,14) || IsPlayerInFrac(playerid,18) || IsPlayerInFrac(playerid,23) || IsPlayerInFrac(playerid,24) || IsPlayerInFrac(playerid,4))
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,2324.4922,-1149.0463,1050.7101) || IsPlayerInRangeOfPoint(playerid,4.0,2807.6880,-1174.2935,1025.5703) || IsPlayerInRangeOfPoint(playerid,4.0,318.6295,1115.3989,1083.8828) || IsPlayerInRangeOfPoint(playerid,4.0,2807.6880,-1174.2935,1025.5703) || IsPlayerInRangeOfPoint(playerid,4.0,1494.4487,1304.0544,1093.2891) || IsPlayerInRangeOfPoint(playerid,4.0,140.3376,1366.1144,1083.4369) || IsPlayerInRangeOfPoint(playerid,4.0,1261.3036,-785.4796,1091.9063) || IsPlayerInRangeOfPoint(playerid,4.0,-2636.7258,1402.9813,906.4609) || IsPlayerInRangeOfPoint(playerid,4.0,-2636.7258,1402.9813,906.4609) || IsPlayerInRangeOfPoint(playerid,4.0,-308.4424,1538.4647,75.5625) || IsPlayerInRangeOfPoint(playerid,4.0,2324.4922,-1149.0463,1050.7101) || IsPlayerInRangeOfPoint(playerid,4.0,322.2144,302.7917,999.1484,179))
    {
    SetPlayerHealth(playerid,100);
    }
    }
    return 1;
    }




    C:\Windows\Vss\German v1.1\German[Scripts]\German-Next-Era-Life---v2.5\German Next Era Life - v2.5\gamemodes\GNE.pwn(43722) : error 075: input line too long (after substitutions)
    C:\Windows\Vss\German v1.1\German[Scripts]\German-Next-Era-Life---v2.5\German Next Era Life - v2.5\gamemodes\GNE.pwn(43723) : error 017: undefined symbol "IsPlayerInRang"
    C:\Windows\Vss\German v1.1\German[Scripts]\German-Next-Era-Life---v2.5\German Next Era Life - v2.5\gamemodes\GNE.pwn(43724) : error 017: undefined symbol "eOfPoint"
    C:\Windows\Vss\German v1.1\German[Scripts]\German-Next-Era-Life---v2.5\German Next Era Life - v2.5\gamemodes\GNE.pwn(43724) : warning 217: loose indentation
    C:\Windows\Vss\German v1.1\German[Scripts]\German-Next-Era-Life---v2.5\German Next Era Life - v2.5\gamemodes\GNE.pwn(43724) : error 029: invalid expression, assumed zero
    C:\Windows\Vss\German v1.1\German[Scripts]\German-Next-Era-Life---v2.5\German Next Era Life - v2.5\gamemodes\GNE.pwn(43725) : warning 217: loose indentation



    hm stimmt doch alles lol?

  • Das Problem ist die Länge der Zeile.
    Versuche es so:
    ocmd:heal(playerid)
    {
    if(IsPlayerInFrac(playerid,1) || IsPlayerInFrac(playerid,2) || IsPlayerInFrac(playerid,3))
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,255.0789,77.4782,1003.6406) || IsPlayerInRangeOfPoint(playerid,4.0,197.8206,168.2515,1003.0234) || IsPlayerInRangeOfPoint(playerid,4.0,225.0941,121.8315,999.0803))
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    }
    }
    else if(IsPlayerInFrac(playerid,6) || IsPlayerInFrac(playerid,7) || IsPlayerInFrac(playerid,8) || IsPlayerInFrac(playerid,9) || IsPlayerInFrac(playerid,13) ||
    IsPlayerInFrac(playerid,14) || IsPlayerInFrac(playerid,18) || IsPlayerInFrac(playerid,23) || IsPlayerInFrac(playerid,24) || IsPlayerInFrac(playerid,4))
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,2324.4922,-1149.0463,1050.7101) || IsPlayerInRangeOfPoint(playerid,4.0,2807.6880,-1174.2935,1025.5703) ||
    IsPlayerInRangeOfPoint(playerid,4.0,318.6295,1115.3989,1083.8828) || IsPlayerInRangeOfPoint(playerid,4.0,2807.6880,-1174.2935,1025.5703) ||
    IsPlayerInRangeOfPoint(playerid,4.0,1494.4487,1304.0544,1093.2891) || IsPlayerInRangeOfPoint(playerid,4.0,140.3376,1366.1144,1083.4369) ||
    IsPlayerInRangeOfPoint(playerid,4.0,1261.3036,-785.4796,1091.9063) || IsPlayerInRangeOfPoint(playerid,4.0,-2636.7258,1402.9813,906.4609) ||
    IsPlayerInRangeOfPoint(playerid,4.0,-2636.7258,1402.9813,906.4609) || IsPlayerInRangeOfPoint(playerid,4.0,-308.4424,1538.4647,75.5625) ||
    IsPlayerInRangeOfPoint(playerid,4.0,2324.4922,-1149.0463,1050.7101) || IsPlayerInRangeOfPoint(playerid,4.0,322.2144,302.7917,999.1484,179))
    {
    SetPlayerHealth(playerid,100);
    }
    }
    return 1;
    }

  • C:\Windows\Vss\German v1.1\German[Scripts]\German-Next-Era-Life---v2.5\German Next Era Life - v2.5\gamemodes\GNE.pwn(43729) : warning 202: number of arguments does not match definition




    ocmd:heal(playerid)
    {
    if(IsPlayerInFrac(playerid,1) || IsPlayerInFrac(playerid,2) || IsPlayerInFrac(playerid,3))
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,255.0789,77.4782,1003.6406) || IsPlayerInRangeOfPoint(playerid,4.0,197.8206,168.2515,1003.0234) || IsPlayerInRangeOfPoint(playerid,4.0,225.0941,121.8315,999.0803))
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    }
    }
    else if(IsPlayerInFrac(playerid,6) || IsPlayerInFrac(playerid,7) || IsPlayerInFrac(playerid,8) || IsPlayerInFrac(playerid,9) || IsPlayerInFrac(playerid,13) ||
    IsPlayerInFrac(playerid,14) || IsPlayerInFrac(playerid,18) || IsPlayerInFrac(playerid,23) || IsPlayerInFrac(playerid,24) || IsPlayerInFrac(playerid,4))
    {
    if(IsPlayerInRangeOfPoint(playerid,4.0,2324.4922,-1149.0463,1050.7101) || IsPlayerInRangeOfPoint(playerid,4.0,2807.6880,-1174.2935,1025.5703) ||
    IsPlayerInRangeOfPoint(playerid,4.0,318.6295,1115.3989,1083.8828) || IsPlayerInRangeOfPoint(playerid,4.0,2807.6880,-1174.2935,1025.5703) ||
    IsPlayerInRangeOfPoint(playerid,4.0,1494.4487,1304.0544,1093.2891) || IsPlayerInRangeOfPoint(playerid,4.0,140.3376,1366.1144,1083.4369) ||
    IsPlayerInRangeOfPoint(playerid,4.0,1261.3036,-785.4796,1091.9063) || IsPlayerInRangeOfPoint(playerid,4.0,-2636.7258,1402.9813,906.4609) ||
    IsPlayerInRangeOfPoint(playerid,4.0,-2636.7258,1402.9813,906.4609) || IsPlayerInRangeOfPoint(playerid,4.0,-308.4424,1538.4647,75.5625) ||
    IsPlayerInRangeOfPoint(playerid,4.0,2324.4922,-1149.0463,1050.7101) || IsPlayerInRangeOfPoint(playerid,4.0,322.2144,302.7917,999.1484,179)) //Hier aber warum?
    {
    SetPlayerHealth(playerid,100);
    }
    }
    return 1;
    }

  • Danke, Klappt


    Wie mache ich



    ocmd:swat(playerid,params[])
    {
    if(IsPlayerInFrac(playerid,2))
    {
    SetPlayerSkin(playerid, 285);
    {
    return 1;
    }



    Spieler bekommt ja den Skin 285 und wie lasse ich sein Namen Cangen auf Agent (randomzahl)


    und wen er aus swat rausgeht soll er wider sein Normalen namen bekommen und den skin was er hatte

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • und wen er aus swat rausgeht soll er wider sein Normalen namen bekommen und den skin was er hatte

    Du musst die Skin ID (GetPlayerSkin) sowie den Name in dem undercover-Befehl in eine Spielervariable speichern, und beim zurücksetzen dem Spieler wieder geben (SetPlayerSkin / SetPlayerName).




    wie lasse ich sein Namen Cangen auf Agent (randomzahl)


    new name[MAX_PLAYER_NAME], c;
    NOCHMAL_NAME:
    c++;
    if(c > 1000) return SendClientMessage(playerid, 0xFF0000FF, "Error: Nicht möglich.");
    format(name, MAX_PLAYER_NAME, "Agent_%d", random(100000));
    if(ReturnPlayerID(name) != INVALID_PLAYER_ID) goto NOCHMAL_NAME;
    SetPlayerName(playerid, name);


  • ocmd:swat(playerid,params[])
    {
    if(IsPlayerInFrac(playerid,2))
    {
    SetPlayerSkin(playerid, 285);
    new name[MAX_PLAYER_NAME], c;
    NOCHMAL_NAME:
    c++;
    if(c > 1000) return SendClientMessage(playerid, 0xFF0000FF, "Error: Nicht möglich.");
    format(name, MAX_PLAYER_NAME, "Agent_%d", random(100000));
    if(ReturnPlayerID(name) != INVALID_PLAYER_ID) goto NOCHMAL_NAME;
    SetPlayerName(playerid, name);
    {
    return 1;
    }



    So Gemeint hab scheinbar ein klammer fehler?

  • Von selbst nicht, das musst du hinzufügen. Habe dir hier erklärt wie:

    Du musst die Skin ID (GetPlayerSkin) sowie den Name in dem undercover-Befehl in eine Spielervariable speichern, und beim zurücksetzen dem Spieler wieder geben (SetPlayerSkin / SetPlayerName).

    Versuche das mal umzusetzen.

  • new MaskLabel[MAX_PLAYERS];



    C:\Windows\Vss\German v1.1\German[Scripts]\German-Next-Era-Life---v2.5\German Next Era Life - v2.5\gamemodes\GNE.pwn(16660) : warning 213: tag mismatch




    if(strcmp(cmdtext, "/mask", true) == 0)
    {
    if(IsPlayerInFrac(playerid,8))
    {
    if(Maske[playerid] == 1)
    {
    for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, 1);
    Maske[playerid] = 0;
    DeletePVar(playerid,"Zahl");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Du hast deine Maske abgenommen.");
    }
    else if(Maske[playerid] == 0)
    {
    for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, 0);
    Maske[playerid] = 1;
    new Zahl = random(30);
    SetPVarInt(playerid,"Zahl",Zahl);
    new str[32];
    format(str, sizeof(str), "Maskierter %d", random(30));
    MaskLabel[playerid] = Create3DTextLabel(str, 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); //Hier
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Du hast deine Maske aufgesetzt.");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du kannst keine Maske aufsetzen!");
    }
    return 1;
    }