Geld bekommen wenn jemand jemand tötet

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 liebe Brotfische ;D


    Ich habe ein Problem. Ic versuche grade verzweifelt etwas zu scripten, das ein Gang-Mitglied der Grove ein Mitglied der Rifa töten kann und dafür Geld bekommt.
    Meine diesmalige Abfrage der Fraktionen läuft über [pMember][pLeader].


    Ich habe bisher folgende Ergebnisse:


    if(IsPlayerConnected(killer123))
    {
    new killer123, gekillter;
    GetPlayerName(killerid, killer123, sizeof(killer123));
    if([PlayerInfo][killer123][pLeaer]==6)
    {
    if([PlayerInfo][gekillter][pLeader]==12)
    {
    GivePlayerMoney(killer123,1000);
    }
    }
    }


    - Und diés mit folgenden Errors:


    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(6441) : warning 217: loose indentation
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : error 017: undefined symbol "killer123"
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14289) : error 035: argument type mismatch (argument 2)
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14289) : error 035: argument type mismatch (argument 2)
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14290) : error 029: invalid expression, assumed zero
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14290) : warning 215: expression has no effect
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14290) : error 001: expected token: ";", but found "]"
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14290) : error 029: invalid expression, assumed zero
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14290) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    7 Errors.


    Muss bis 18Uhr fertig sein, bitte um schnelle Hilfe :D


    //edit: Die Fraktionsnummer von Rifa ist 6, die von GS ist 12. Tötet sich jemand innerhalb der Gang, bekommt der Mörder kein Geld. [Grove Member tötet Grove Leaer, soll kein Geld gebn]


    Mfg

    Liebe Grüße


    Marcel

  • Warum machst du es dir so schwer?
    Mach eifnach unter OnPlayerDeath


    if(PlayerInfo[killerid][pLeader] == 6) //Musst es auf deine Fraktionen anpassen
    {
    if(PlayerInfo[playerid][pLeader] == 4) //Musst es auf deine Fraktionen anpassen
    {
    GivePlayerMoney(playerid, -30);
    GivePlayerMoney(killerid, 50);
    }
    }
    Usw. Ist zwar Unschonend GEscriptet funktzuniert aber :D

  • Angepasst. Errors:


    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(6441) : warning 217: loose indentation
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : error 001: expected token: ")", but found "["
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : error 029: invalid expression, assumed zero
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : warning 215: expression has no effect
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : error 001: expected token: ";", but found "]"
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : 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.

    Liebe Grüße


    Marcel

  • Viel Spaß damit :P :D



    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(PlayerInfo[killerid][pMember][pLeader] == 12) || if(PlayerInfo[killerid][pMember][pLeader] == 6)
    {
    if(PlayerInfo[playerid][pLeader] == 6) || if(PlayerInfo[killerid][pLeader] == 12) //Musst es auf deine Fraktionen anpassen
    {
    GivePlayerMoney(killerid, 1000);
    }
    }
    if(PlayerInfo[killerid][pMember][pLeader] == 12) || if(PlayerInfo[killerid][pMember][pLeader] == 6)
    {
    if(PlayerInfo[playerid][pMember] == 6) || if(PlayerInfo[killerid][pMember] == 12) //Musst es auf deine Fraktionen anpassen
    {
    GivePlayerMoney(killerid, 500);
    }
    }

    new killmsg[60], deathname[MAX_PLAYER_NAME], showmsg[256], killer123[MAX_PLAYER_NAME];
    GetPlayerName(playerid, deathname, sizeof(deathname));
    GetPlayerName(killerid, killer123, sizeof(killer123));
    format(killmsg, sizeof(killmsg), " Du hast %s getötet.", deathname);
    SendClientMessage(killerid, COLOR_YELLOW, killmsg);
    SHAktiv[playerid]=0;
    if(SHAktiv[playerid]==1)
    {
    SHAktiv[playerid]=0;
    SHackA=false;
    }
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= 1332)
    {
    if(ShowDeath[i] == 1)
    {
    new wtext[60];
    if(reason == 0) { wtext = "Keine Schusswaffe"; }
    else if(reason == 1) { wtext = "Brass Knuckles"; }
    else if(reason == 2) { wtext = "Golf Club"; }
    else if(reason == 3) { wtext = "Nite Stick"; }
    else if(reason == 4) { wtext = "Knife"; }
    else if(reason == 5) { wtext = "Baseballschläger"; }
    else if(reason == 6) { wtext = "Shovel"; }
    else if(reason == 7) { wtext = "Billiardschläger"; }
    else if(reason == 8) { wtext = "Katana"; }
    else if(reason == 9) { wtext = "Kettensäge"; }
    else if(reason >= 10 && reason <= 13) { wtext = "Dildo"; }
    else if(reason == 14) { wtext = "Blumen"; }
    else if(reason == 15) { wtext = "Cane"; }
    else if(reason == 16) { wtext = "Grenade"; }
    else if(reason == 17) { wtext = "Tränengas"; }
    else if(reason == 18) { wtext = "Molotov Cocktail"; }
    else if(reason == 22) { wtext = "9mm"; }
    else if(reason == 23) { wtext = "Schallgedämpfte 9mm"; }
    else if(reason == 24) { wtext = "Desert Eagle"; }
    else if(reason == 25) { wtext = "Schrotflinte"; }
    else if(reason == 26) { wtext = "abgesägte Schrotflinte"; }
    else if(reason == 27) { wtext = "automatische Schrotflinte"; }
    else if(reason == 28) { wtext = "Micro SMG"; }
    else if(reason == 29) { wtext = "MP5"; }
    else if(reason == 30) { wtext = "AK-47"; }
    else if(reason == 31) { wtext = "M4"; }
    else if(reason == 32) { wtext = "Tec-9"; }
    else if(reason == 33) { wtext = "Country Rifle"; }
    else if(reason == 34) { wtext = "Scharfschützengewehr"; }
    else if(reason == 35) { wtext = "RPG"; }
    else if(reason == 36) { wtext = "HS Racketen Werfer"; }
    else if(reason == 37) { wtext = "Flammenwerfer"; }
    else if(reason == 38) { wtext = "Minigun"; }
    else if(reason == 39) { wtext = "Satchel Charge"; }
    else if(reason == 40) { wtext = "Detonator"; }
    else if(reason == 41) { wtext = "Spraycan"; }
    else if(reason == 42) { wtext = "Feuerlöscher"; }
    GetPlayerName(killerid, killer123, sizeof(killer123));
    format(showmsg, sizeof(showmsg), " %s hat %s mit einer %s getötet.", killer123, deathname, wtext);
    SendAdminMessage(COLOR_YELLOW, showmsg);
    }
    }
    }
    if(SelfBomb[playerid] == 1)
    {
    SelfBomb[playerid] = 0;
    PlayerInfo[playerid][pJailed] = 4;
    PlayerInfo[playerid][pJailTime] = 600;
    SetPlayerPos(playerid,826.0681,-1102.9940,25.5938);
    SetPlayerWorldBounds(playerid, 951.9454, 807.0247, -1072.5609, -1130.1929);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 1);
    PlayerInfo[playerid][pDead] = 1;
    SpawnPlayer(playerid);
    }
    if(EndAuftrag[killerid] == 1 && SchwarzmarktAuftrag[killerid] == playerid)
    {
    if(WantedLevel[playerid] >= 1 && PlayerInfo[killerid][pMember] == 15 || WantedLevel[playerid] >= 1 && PlayerInfo[killerid][pLeader] == 15)
    {
    if(SavedRobMoney[playerid] == 1)
    {
    PlayerMoney[killerid] = PlayerMoney[killerid] += PlayerRobMoney[playerid];
    PlayerRobMoney[playerid] = 0;
    SavedRobMoney[playerid] = 0;
    RobSkill[playerid] = 0;
    TextDrawHideForPlayer(playerid, rs[playerid]);
    TextDrawHideForPlayer(playerid, rm[playerid]);
    }
    SetPlayerInterior(playerid, 6);
    SetPlayerPos(playerid,264.42,82.05,1001.03);
    SetPlayerFree(playerid,255, "Eingesperrt");
    PlayerInfo[playerid][pJailID] = 1;
    PlayerInfo[playerid][pJailed] = 5;
    PlayerInfo[playerid][pArrested] += 1;
    JailCheck(playerid);
    SetPlayerSkin(playerid, 221);
    }
    }
    TextDrawHideForPlayer(playerid, ftd[playerid]);
    TextDrawHideForPlayer(playerid, sd[playerid]);
    TextDrawHideForPlayer(playerid, fd[playerid]);
    TextDrawHideForPlayer(playerid, kd[playerid]);
    if(AcceptIllegalRace[playerid] != 0)
    {
    AcceptIllegalRace[playerid] = 0;
    racers --;
    }
    PlayerInfo[playerid][pDeaths] ++;
    PlayerInfo[killerid][pKills] ++;
    new name[MAX_PLAYER_NAME];
    new string[256];
    new Float:px,Float:py,Float:pz;
    gPlayerSpawned[playerid] = 0;
    GetPlayerName(playerid, name, sizeof(name));
    PlayerInfo[playerid][pLocal] = 255;
    GetPlayerPos(playerid, px, py, pz);
    Armor[playerid] = 0.0;
    Health[playerid] = 0.0;
    if(WantedLevel[playerid] != 0 && WantedPoints[playerid] != 0)
    {
    PlayerInfo[playerid][pWantedDeaths] ++;
    }
    if(PlayerInfo[playerid][pJailed] != 0 && PlayerInfo[killerid][pJailed] != 0)
    {
    if(PlayerBattleing[playerid] == 0 && PlayerPaintballing[playerid] == 0)
    {
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(killerid, sendername, sizeof(sendername));

    format(string, sizeof(string), "* Du wurdest in Fort DeMorgan gesteckt, Grund: Knast DM.");
    SendClientMessage(killerid, COLOR_LIGHTRED, string);

    format(string, sizeof(string), "AdmCmd: %s wurde nach Fort DeMorgan verlegt, Grund: Knast DM.", sendername);
    SendClientMessageToAll(COLOR_LIGHTRED, string);

    GameTextForPlayer(killerid, "~w~Willkommen in ~n~~r~Fort DeMorgan", 5000, 3);

    PlayerInfo[killerid][pJailed] = 2;
    SetPlayerInterior(killerid, 0);
    PlayerInfo[killerid][pJailTime] = 3600;
    SetPlayerPos(killerid, 107.2300,1920.6311,18.5208);
    SetPlayerWorldBounds(killerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
    }
    }

    Liebe Grüße


    Marcel

  • if(PlayerInfo[killerid][pMember][pLeader] == 12) || if(PlayerInfo[killerid][pMember][pLeader] == 6)
    {
    if(PlayerInfo[playerid][pLeader] == 6) || if(PlayerInfo[killerid][pLeader] == 12) //Musst es auf deine Fraktionen anpassen
    {
    GivePlayerMoney(killerid, 1000);
    }
    }
    if(PlayerInfo[killerid][pMember][pLeader] == 12) || if(PlayerInfo[killerid][pMember][pLeader] == 6)
    {
    if(PlayerInfo[playerid][pMember] == 6) || if(PlayerInfo[killerid][pMember] == 12) //Musst es auf deine Fraktionen anpassen
    {
    GivePlayerMoney(killerid, 500);
    }
    }
    in


    if(PlayerInfo[killerid][pMember][pLeader] == 12 || PlayerInfo[killerid][pMember][pLeader] == 6)
    {
    if(PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[killerid][pLeader] == 12) //Musst es auf deine Fraktionen anpassen
    {
    GivePlayerMoney(killerid, 1000);
    }
    }
    if(PlayerInfo[killerid][pMember][pLeader] == 12 || PlayerInfo[killerid][pMember][pLeader] == 6)
    {
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[killerid][pMember] == 12) //Musst es auf deine Fraktionen anpassen
    {
    GivePlayerMoney(killerid, 500);
    }
    }

  • C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(6441) : warning 217: loose indentation
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : error 001: expected token: ")", but found "["
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : error 029: invalid expression, assumed zero
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : warning 215: expression has no effect
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : error 001: expected token: ";", but found "]"
    C:\Users\Marcel\Desktop\GameCide-Notupdate\gamemodes\GameCide2.1.pwn(14286) : 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.



    ^^ Gehen nicht weg.

    Liebe Grüße


    Marcel

  • if(PlayerInfo[killerid][pMember][pLeader] == 12 || PlayerInfo[killerid][pMember][pLeader] == 6)
    Das ist falsch :D
    in
    if(PlayerInfo[killerid][pLeader] == 12 || PlayerInfo[killerid][pLeader] == 6 ||PlayerInfo[killerid][pMember] == 12 || PlayerInfo[killerid][pMember] == 6)