Nachen den man getötet wird , Crasht man

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 ein Großes Probelm


    wenn ein Cop ein User erschiesst Crasht der Getötete


    wenn mann ein Cop erschiesst Crasht der cop


    woran kann es liegen



    Function OnPlayerDeath(playerid, killerid, reason)
    {
    if(IsPlayerNPC(playerid))return 1;
    M_OnPlayerDeath(playerid,killerid,reason);
    StopAudioStreamForPlayer(playerid);
    new name[MAX_PLAYER_NAME];
    new stringn[256];
    new string[256];
    PlayerInfo[playerid][pInvWeapon] = 0;
    PlayerInfo[playerid][pInvAmmo] = 0;
    PlayerInfo[playerid][pInvWeapon2] = 0;
    PlayerInfo[playerid][pInvAmmo2] = 0;
    Waren3Verkauft[playerid] = 0;
    Waren2Dabei[playerid] = 0;
    WarenDabei[playerid] = 0;
    RemovePlayerAttachedObject(playerid,0);
    GeldwaschCP[playerid] = 0;
    DisablePlayerCheckpoint(playerid);
    new playercash;
    new victimteam;
    new killerteam;
    SetPlayerToTeamColor(playerid);
    ResetPlayerWeapons(playerid);
    PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
    PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
    PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
    PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pAmmo4] = 0;
    if(IsACop(playerid))
    {
    OnDuty[playerid] = 0;
    SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
    SetPlayerSpawn(playerid);
    return 1;
    }
    if(!IsACop(killerid)&&OnDuty[killerid] == 0)
    {
    if(PlayerInfo[killerid][pLeader] == 7)
    {
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(killerid, aname, sizeof(aname));
    WantedLevel[killerid] += 6;
    format(stringn,sizeof(stringn),"Du hast ein Verbrechen begangen: Präsidentmord, Zeuge: Anonym");
    SendClientMessage(killerid, COLOR_LIGHTRED, stringn);
    format(stringn,sizeof(stringn),"*Vergebene Wanteds: 6, Aktuelles WantedLevel: %d", WantedLevel[killerid]);
    SendClientMessage(killerid,COLOR_YELLOW, stringn);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsACop(i) && OnDuty[i] == 1)
    {
    format(stringn, sizeof(stringn), "%s wird gesucht, Verbrechen: Präsidentmord, Zeuge: Anonym, Vergebene Wanteds: 6", aname);
    SendClientMessage(i, COLOR_ORANGE, stringn);
    }
    }
    }
    else
    {
    WantedLevel[killerid] += 3;
    format(stringn,sizeof(stringn),"Du hast ein Verbrechen begangen: Mord, Zeuge: Anonym");
    SendClientMessage(killerid, COLOR_LIGHTRED, stringn);
    format(stringn,sizeof(stringn),"*Vergebene Wanteds: 3, Aktuelles WantedLevel: %d", WantedLevel[killerid]);
    SendClientMessage(killerid,COLOR_YELLOW, stringn);
    }
    }
    if(gPlayerUsingLoopingAnim[playerid])
    {
    gPlayerUsingLoopingAnim[playerid] = 0;
    }
    if(PlayerOnFire[playerid])
    {
    SendClientMessage(playerid, 0xff000000, "Du bist verbrannt!"); StopPlayerBurning(playerid);
    }
    if(BlindFold[playerid] == 1)
    {
    BlindFold[playerid] = 0;
    }
    if(PlayerInfo[playerid][pMauled] == 1)
    {
    PlayerInfo[playerid][pMauled] = 0;
    }
    InCargo[playerid] = 0; InLevi[playerid] = 0; InAndro[playerid] = 0; InSham[playerid] = 0; InEnfo[playerid] = 0;
    if(FirstSpawn[playerid] == 1)
    {
    FirstSpawn[playerid] = 0;
    }
    //=======================
    victimteam = gTeam[playerid];
    killerteam = gTeam[killerid];
    gPlayerSpawned[playerid] = 0;
    GetPlayerName(playerid, name, sizeof(name));
    PlayerInfo[playerid][pLocal] = 255;
    if(killerid != 255)
    if(reason == 38)
    {
    new kstring[128];
    new kickname[MAX_PLAYER_NAME];
    if(IsPlayerConnected(killerid))
    {
    GetPlayerName(killerid, kickname, sizeof(kickname));
    format(string, 256, "Warnung: [%d]%s hat einen Spieler mit einer Minigun gekillt. ACHTUNG [CheatVerdacht].",killerid,kickname);
    ABroadCast(COLOR_YELLOW,string,1);
    printf("%s", kstring);
    return 1;
    }
    }
    if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
    {
    DisablePlayerCheckpoint(playerid);
    gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
    }
    new caller = Mobile[playerid];
    if(caller != 255)
    {
    if(caller < 255)
    {
    SendClientMessage(caller, COLOR_GRAD2, " Die Verbindung wurde unterbrochen....");
    CellTime[caller] = 0;
    CellTime[playerid] = 0;
    Mobile[caller] = 255;
    }
    Mobile[playerid] = 255;
    CellTime[playerid] = 0;
    }
    ClearCrime(playerid);
    if(PlayerPaintballing[playerid] != 0)
    {
    PlayerPaintballKills[killerid] ++;
    if(PlayerPaintballKills[killerid] > PaintballWinnerKills)
    {
    new killer[MAX_PLAYER_NAME];
    PaintballWinner = killerid;
    PaintballWinnerKills = PlayerPaintballKills[killerid];
    GetPlayerName(killerid, killer, sizeof(killer));
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerPaintballing[i] != 0)
    {
    format(string, sizeof(string), "* %s ist mit %d Kills in Führung.",killer,PaintballWinnerKills);
    SendClientMessage(i, COLOR_WHITE, string);
    }
    }
    }
    }
    return 1;
    }
    if(GettingCK[playerid] < 999 || OnCK[playerid] < 999)
    {
    if(IsPlayerConnected(killerid))
    {
    if(GettingCK[killerid] < 999 || OnCK[playerid] < 999)
    {
    new killer[MAX_PLAYER_NAME];
    new dier[MAX_PLAYER_NAME];
    GetPlayerName(playerid, dier, sizeof(dier));
    GetPlayerName(killerid, killer, sizeof(killer));
    format(string, sizeof(string), "* %s hat deinen Charakter gesperrt, du kannst nun mit diesem Charakter nicht mehr Spielen.",killer);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    format(string, sizeof(string), "**%s hat den Spieler %s erledigt**",killer,dier);
    CKLog(string);
    PlayerInfo[playerid][pCK] = 1;
    if(GettingCK[playerid] < 999) { GettingCK[playerid] = 999; }
    else if(OnCK[playerid] < 999) { OnCK[playerid] = 999; }
    if(GettingCK[killerid] < 999) { GettingCK[killerid] = 999; }
    else if(OnCK[killerid] < 999) { OnCK[killerid] = 999; }
    KickPlayer[playerid] = 1;
    }
    }
    }
    if(PlayerInfo[playerid][pHeadValue] > 0)
    {
    if(IsPlayerConnected(killerid))
    {
    if(PlayerInfo[killerid][pMember] == 8 || PlayerInfo[killerid][pLeader] == 8)
    {
    ConsumingMoney[killerid] = 1;
    new killer[MAX_PLAYER_NAME];
    GetPlayerName(killerid, killer, sizeof(killer));
    FraktionsKasse[7] += PlayerInfo[playerid][pHeadValue];
    format(string,128,"Hitman %s hat den Auftrag an %s erfüllt und bekommt: $%d",killer,name,PlayerInfo[playerid][pHeadValue]/2);
    SendFamilyMessage(8, COLOR_YELLOW, string);
    printf("%s", string);
    format(string, sizeof(string), "Auf dich wahr ein Kopfgeld in Hohe von $%d Gesetzt", PlayerInfo[playerid][pHeadValue]);
    SendClientMessage(playerid, 0xff000000, string);
    PlayerInfo[playerid][pHeadValue] = 0;
    return 1;
    }
    }
    }
    if(victimteam >= 4)
    {
    if(IsPlayerConnected(killerid))
    {
    new slice = 100; //$100
    playercash = GetPlayerMoney(playerid);
    if(gTeam[killerid] != 2 && PlayerInfo[killerid][pMember] != 7) { WantedPoints[killerid] += 2; } //+ 2 wanted points
    if(SafeTime[playerid] <= 0)
    {
    if(gTeam[killerid] != gTeam[playerid])
    {
    if(GetPlayerState(killerid) == 1)
    {
    PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 1;
    }
    else
    {
    PlayerInfo[killerid][pKills]++;
    }
    PlayerInfo[playerid][pDeaths]++;
    }
    }
    if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || (gTeam[killerid] == gTeam[playerid] && gTeam[playerid] != 4))
    {
    slice = 0;
    }
    if (((gTeam[killerid]) != 4) && ((gTeam[killerid]) == gTeam[playerid]))//no team kill
    {
    slice = 0;
    }
    if (playercash > 0)
    {
    GivePlayerMoney(playerid, -slice);
    }
    else
    {
    slice = slice+500;
    }
    GivePlayerMoney(killerid, slice);
    PlayerPlaySound(killerid, 1083, 0.0, 0.0, 0.0);
    if (((gTeam[killerid]) == 3) && reason == 49)
    {
    SetPlayerCriminal(killerid,255, "Fahrerflucht");
    }
    }
    }
    else if (victimteam == 2)
    {
    if(IsPlayerConnected(killerid))
    {
    // Cop kill
    PlayerInfo[playerid][pKills]--;
    if (gTeam[killerid] == 2)//cops kill cop
    {
    PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
    GivePlayerMoney(killerid, -suecost);
    GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
    }
    if (gTeam[killerid] >= 3)
    {
    WantedPoints[killerid] += 2; //+ 2 wanted points
    if(reason != 49)
    {
    SetPlayerCriminal(killerid,255, "Vorsätzlicher Mord");
    }
    else if (reason == 49)
    {
    SetPlayerCriminal(killerid,255, "Fahrerflucht");
    }
    }
    if(gTeam[killerid] >= 5 && SafeTime[playerid] <= 0)
    {
    if(GetPlayerState(killerid) == 1)
    {
    PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills]+2;
    }
    else
    {
    PlayerInfo[killerid][pKills]++;
    }
    WantedPoints[killerid]+=2;
    }
    }
    }
    else if (victimteam == 3)
    {
    if(IsPlayerConnected(killerid))
    {
    // Civ kill
    if ((gTeam[killerid]) == 2 || PlayerInfo[killerid][pMember] == 7)//cops kill civ
    {
    if(WantedLevel[playerid] < 1)
    {
    PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
    GivePlayerMoney(killerid, -suecost);
    GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
    }
    }
    else
    {
    WantedPoints[killerid] += 2;
    }
    if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason != 49)
    {
    SetPlayerCriminal(killerid,255, "Vorsätzlicher Mord");
    }
    else if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason == 49)
    {
    SetPlayerCriminal(killerid,255, "Fahrerflucht");
    }
    }
    }
    else if (victimteam == 1)
    {
    if(IsPlayerConnected(killerid))
    {
    // Civ kill
    if ((gTeam[killerid]) == 2)//cops kill civ
    {
    PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
    GivePlayerMoney(killerid, -suecost);
    GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
    }
    else if ((gTeam[killerid]) == 1)//med kill civ
    {
    PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
    GivePlayerMoney(killerid, -suecost);
    GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
    }
    if (((gTeam[killerid]) == 4) && reason != 49)
    {
    SetPlayerCriminal(killerid,255, "Vorsätzlicher Mord");
    }
    else if (((gTeam[killerid]) == 3) && reason == 49)
    {
    SetPlayerCriminal(killerid,255, "Fahrerflucht");
    }
    }
    }
    if (victimteam >= 3 && WantedPoints[playerid] > 0 && killerteam == 2)
    {
    SetPlayerFree(playerid,killerid, "Gekillt");
    }
    if(WantedLevel[playerid] >= 1 && IsACop(killerid) && OnDuty[killerid]==1)
    {
    if(IsPlayerConnected(playerid) && CrimInRange(30.0, killerid,playerid))
    {
    new giveplayer[MAX_PLAYER_NAME];
    GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
    new price = WantedLevel[playerid] * 100;
    format(string, sizeof(string), "~w~Verbrecher getoetet ~g~$%d", price);
    GameTextForPlayer(killerid, string, 5000, 1);
    format(string, sizeof(string), "[KNAST INFO]: %s wurde eingesperrt", giveplayer);
    SendClientMessageToAll(0xFFFF00FF,string);
    ConsumingMoney[killerid] = 1;
    UnFreezePlayer(killerid);
    PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
    PlayerInfo[playerid][pTot] = 0;
    RemovePlayerAttachedObject(playerid,0);
    C4inderhand[playerid]=0;
    GeldwaschCP[playerid] = 0;
    DisablePlayerCheckpoint(playerid);
    if(GetPVarInt(playerid, "StartmullJob")==1){
    MullDuty[playerid] = 0;
    SetPVarInt(playerid, "Mullholen", 0);
    SetPVarInt(playerid, "StartmullJob", 0);
    DestroyVehicle(GetPVarInt(playerid, "MullCarID"));
    SetPVarInt(playerid, "MullCarID", 0);
    SetPVarInt(playerid, "Muell", 0);
    PlayerInfo[playerid][Muellcheckpoint] = 0;
    print("Muellwagen gelöscht wegen Knast");
    }
    PlayerTextDrawShow(playerid, knastminuten[playerid][0]);
    PlayerTextDrawShow(playerid, knastminuten[playerid][1]);
    TextDrawShowForPlayer(playerid, KnastTimeDraw[0]);
    TextDrawShowForPlayer(playerid, KnastTimeDraw[1]);
    TextDrawShowForPlayer(playerid, KnastTimeDraw[2]);
    return 1;
    }
    else
    {
    SendClientMessage(killerid,0xAA3333AA,"Der Spieler ist zu weit weg von dir also landet er in der Base/Krankenhaus!");
    }
    }
    killerid = INVALID_PLAYER_ID;
    SetPlayerColor(playerid,COLOR_GRAD2);
    if(GetPVarInt(playerid, "StartmullJob")==1){
    MullDuty[playerid] = 0;
    SetPVarInt(playerid, "Mullholen", 0);
    SetPVarInt(playerid, "StartmullJob", 0);
    DestroyVehicle(GetPVarInt(playerid, "MullCarID"));
    SetPVarInt(playerid, "MullCarID", 0);
    SetPVarInt(playerid, "Muell", 0);
    PlayerInfo[playerid][Muellcheckpoint] = 0;
    print("Muellwagen gelöscht wegen Tod");
    }
    PlayerInfo[playerid][pTot] = 1;
    SetTimerEx("TotPos",1000,0,"i",playerid);
    return 1;
    }

    wenn ihr noch was vom Script braucht einfach schreiben


    mfg Paddy87