Alle bekommen Gamecrash wenn jemand stirbt

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
  • Hey Leute,


    Ich habe ein Problem unzwar ist es manchmal so das wenn jemand gekillt wird sogut wie alle in der Umgebung einen GameCrash kriegen.


    Ein Freund der auch auf einen Server gezockt hatte die das Problem auch hatten hat gesagt das es höchstwahrscheinlich sein kann das der Skin ab und zu mal beim Tot
    zu schnell geändert wird. (Auf meinen server ist halt ein Friedhofsystem wo man dann den Toten Skin kriegt)
    Und ja wiegesagt ich vermute nämlich auch das es daran liegt das er zu schnell den Skin kriegt.


    Kann man nicht irgentwie machen das er erst so gefreezed oder so ist? Ich weiß ja nicht wie man sowas fixen kann.


    Lg
    Rocc0w

  • Evt kann es auch an einer ungültigen killerid liegen (INVALID_PLAYER_ID).


    Dann würde aber der Server crashen.


    Bist du sicher, dass du die richtige Skin ID verwendest? Denn (in 0,3c wurde es wohl gefixt, bin mir aber immernoch nicht sicher) wenn du eine SkinID verwendest, die es nicht gibt, crashen alle, bei denen der Spieler eingestream ist (wie gesagt, ich bin mir nicht sicher. Ich glaub aber, dass die ungültigen SkinIDs mit CJs ersetzt wurden.)

  • public OnPlayerDeath(playerid, killerid, reason)
    {
    if((RegistrationStep[playerid] == 0 && PlayerPaintballing[playerid] == 0) && FirstSpawn[playerid] == 0)
    {
    PlayerInfo[playerid][pTot] = 1;
    new Float:pX,Float:pY,Float:pZ;
    new name[MAX_PLAYER_NAME];
    GetPlayerPos(playerid, pX, pY, pZ);
    TotenKopf[playerid][0] = CreatePickup(1254,1, pX, pY, pZ);
    SetPlayerCheckpoint(playerid,pX, pY, pZ, 4.0);
    PlayerInfo[playerid][pTx] = pX;
    PlayerInfo[playerid][pTy] = pY;
    PlayerInfo[playerid][pTz] = pZ;
    TogglePlayerControllable(playerid, 1);
    PlayerInfo[playerid][pDeaths] += 1;
    GetPlayerName(playerid, name, sizeof(name));
    }
    if(FirstSpawn[playerid] == 1)
    {
    FirstSpawn[playerid] = 0;
    }

    if(IsAFK[playerid] > 0)
    {
    IsAFK[playerid] = 0;
    Delete3DTextLabel(AFK[playerid]);
    }

    if(issliding[playerid] != 0)
    {
    //OnPlayerDeathBug


    //end
    SendClientMessage(playerid,COLOR_ORANGE,"Ups, deine Hände sind aus Versehen abgerutscht ! Versuchs noch einmal .");
    for(new i=0; i<ropelength; i++)
    {
    b_SetObjectPos(seile[i][tempplayerid[playerid]],0,0,-90000);
    notstarted[playerid] = 0;
    }
    issliding[playerid] = 0;
    issliding[tempplayerid[playerid]] = 0;
    ClearAnimations(playerid);
    }

    if(PlayerSFDM[playerid] == 1 || PlayerInfo[playerid][pTot] == 0)
    {
    if(PlayerSFDM[killerid] == 1)
    {
    PlayerSFDMKills[killerid]+=1;
    if(PlayerSFDMKills[killerid] > SFDMWinnerKills)
    {
    new string2[256];
    new string[256];
    new killer[MAX_PLAYER_NAME];
    //SFDMWinner = killerid;
    SFDMWinnerKills = PlayerSFDMKills[killerid];
    GetPlayerName(killerid, killer, sizeof(killer));
    format(string2, sizeof(string2), "* %s is in the lead (%d kills)", killer, SFDMWinnerKills);
    format(string, sizeof(string), "* %s ist mit %d Kills in Führung.",killer,SFDMWinnerKills);
    SendUserMessageToAll(COLOR_YELLOW, string, string2);
    if(SFDMWinnerKills == 25)
    {
    StopSFDM();
    }
    }
    }
    }

    IsInNev[playerid] = 0;
    RemovePlayerAttachedObject(playerid, 1);
    TogglePlayerControllable(playerid, 1);
    new name[MAX_PLAYER_NAME];
    new string2[256];
    new string[256];
    //new dmessage[128];
    //new deathreason[20];
    new playercash;
    new victimteam;
    new Float:px,Float:py,Float:pz;
    victimteam = gTeam[playerid];
    PlayerInfo[playerid][pfirstlog] = 0;
    gPlayerSpawned[playerid] = 0;
    GetPlayerName(playerid, name, sizeof(name));
    PlayerInfo[playerid][pLocal] = 255;
    GetPlayerPos(playerid, px, py, pz);
    if(killerid != 255)
    {
    if(GetPlayerState(killerid) == 2)
    {
    new dstring[128];
    new drivername[MAX_PLAYER_NAME];
    GetPlayerName(killerid, drivername, sizeof(drivername));
    SendClientMessage(killerid, COLOR_YELLOW, "Mache keine DriveBy Kills!");
    format(string, 256, "AdmWarnung: [%d]%s hat gerade einen Spieler DriveBy gekillt.",killerid,drivername);
    ABroadCast(COLOR_YELLOW,string,1);
    printf("%s", dstring);
    return 1;
    }
    }
    if(reason == 38)
    {
    new kstring[128];
    new kickname[MAX_PLAYER_NAME];
    if(IsPlayerConnected(killerid))
    {
    GetPlayerName(killerid, kickname, sizeof(kickname));
    format(string, 256, "AdmWarnung: [%d]%s hat gerade einen Spieler mit einer Minigun gekillt.",killerid,kickname);
    ABroadCast(COLOR_YELLOW,string,1);
    printf("%s", kstring);
    return 1;
    }
    }

    if(IsAFBI(playerid) || IsALSPD(playerid) || IsASFPD(playerid) || IsABundeswehr(playerid) || IsAnAmbulance(playerid))
    {
    if(OnDuty[playerid] == 1)
    {
    ResetPlayerWeapons(playerid);
    SetPlayerColor(playerid,zivicolor);
    SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
    OnDuty[playerid] = 0;
    }
    }


    if(IsATaxi(playerid) || IsAOamt(playerid))
    {
    if(JobDuty[playerid] == 0)
    {
    ResetPlayerWeapons(playerid);
    SetPlayerColor(playerid,zivicolor);
    SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
    JobDuty[playerid] = 0;
    }
    }

    if(WantedLevel[playerid] >= 1 && IsACop(killerid) == 1)
    {
    // An den Polizisten
    new price = WantedLevel[playerid] * 150;
    new count;
    DestroyPickup(TotenKopf[playerid][0]);
    PlayerInfo[playerid][pTot] = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(IsACop(i) && CrimInRange(30.0, playerid,i))
    {
    count = 1;
    format(string, sizeof(string), "~w~Gesuchten umgebracht~n~Bonus: ~g~$%d", price / 3);
    GameTextForPlayer(i, string, 5000, 1);
    ConsumingMoney[i] = 1;
    //GivePlayerMoney[killerid] = GivePlayerMoney[killerid]+(price/4);
    GivePlayerMoney(i, price / 3);
    PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
    }
    }
    }
    if(count == 1)
    { // An den Gesuchten
    DestroyPickup(TotenKopf[playerid][0]);
    PlayerInfo[playerid][pTot] = 0;
    DisablePlayerCheckpoint(playerid);
    SetPlayerInterior(playerid, 6);
    SetPlayerHealth(playerid, 30.0);
    SetCameraBehindPlayer(playerid);
    SetPlayerPos(playerid,264.3158,86.5841,1001.0391);
    GivePlayerMoney(playerid, - price);
    PlayerInfo[playerid][pWantedDeaths] += 1;
    PlayerInfo[playerid][pJailed] = 8;
    PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid] * 60);
    format(string, sizeof(string), "Du bist für %d Sekunden im Gefängnis und musst $%d bezahlen.", PlayerInfo[playerid][pJailTime], price);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    SendClientMessage(playerid, COLOR_LIGHTRED, "Tipp /jailtime um deine verbleibende Zeit zu sehen.");
    WantedLevel[playerid] = 0;
    SetPlayerWantedLevel(playerid,0);
    }
    }

    if(PlaysLSPDDM[playerid] == 1)
    {
    new name2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(killerid, name2, sizeof(name2));
    format(string, sizeof(string), "DM: %s wurde von %s getötet", name, name2);
    format(string2, sizeof(string2), "DM: %s got killed by %s", name, name2);
    SendUserMessageToAll(COLOR_RED, string, string2);
    LSPDDMPlayers--;
    PlaysLSPDDM[playerid] = 0;
    LSPDDM = 2;
    LSPDDeathmatch();
    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 Leitung ist tod!");
    CellTime[caller] = 0;
    CellTime[playerid] = 0;
    Mobile[caller] = 255;
    }
    Mobile[playerid] = 255;
    CellTime[playerid] = 0;
    }
    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 einen Charakter Kill für dich eingeleitet. Du kannst mit diesem Charakter nicht mehr spielen!",killer);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    format(string, sizeof(string), "** %s hat den Charakter von %s gekillt! **",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(gTeam[killerid] == 10 || PlayerInfo[killerid][pLeader] == 8)
    {
    if(GoChase[killerid] == playerid)
    {
    ConsumingMoney[killerid] = 1;
    new killer[MAX_PLAYER_NAME];
    GetPlayerName(killerid, killer, sizeof(killer));
    GivePlayerMoney(killerid, PlayerInfo[playerid][pHeadValue]);
    format(string,128,"<< Hitman %s hat den Vertrag mit %s erledigt und %d$ bekommen. >>",killer,name,PlayerInfo[playerid][pHeadValue]);
    SendFamilyMessage(8, COLOR_YELLOW, string);
    PlayerInfo[playerid][pHeadValue] = 0;
    GotHit[playerid] = 0;
    GetChased[playerid] = 999;
    GoChase[killerid] = 999;
    }
    }
    }
    }
    if(victimteam >= 4)
    {
    if(IsPlayerConnected(killerid))
    {
    //new killer[MAX_PLAYER_NAME];
    //GetPlayerName(killerid, killer, sizeof(killer));
    new slice = 100; //$100
    playercash = GetPlayerMoney(playerid);
    if(SafeTime[playerid] <= 0)
    {
    if(gTeam[killerid] != gTeam[playerid])
    {
    if(GetPlayerState(killerid) == 1)
    {
    PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 2;
    }
    else
    {
    PlayerInfo[killerid][pKills]++;
    }
    PlayerInfo[playerid][pKills]--;
    }
    }
    /*if (strlen(deathreason) > 0)// patch
    {
    if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || gTeam[killerid] == gTeam[playerid])//med kill criminal
    {
    format(string, sizeof(string), ".: %s murdered %s. (%s) :.", killer, name, deathreason);
    }
    else
    {
    format(string, sizeof(string), ".: %s murdered %s. (%s) for $%d :.", killer, name, deathreason, slice);
    }


    }
    else
    {
    if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill || gTeam[killerid] == gTeam[playerid]))
    {
    format(string, sizeof(string), ".: %s murdered %s :.", killer, name);
    }
    else
    {
    format(string, sizeof(string), ".: %s murdered %s for $%d :.", killer, name, slice);
    }
    }*/
    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);
    //GameTextForPlayer(playerid, dmessage, 5000, 2);
    PlayerPlaySound(killerid, 1083, 0.0, 0.0, 0.0);
    if (((gTeam[killerid]) == 3) && reason != 49)
    {
    SetPlayerCriminal(killerid,255, "1-8-7 on a cop");
    }
    else if (((gTeam[killerid]) == 3) && reason == 49)
    {
    SetPlayerCriminal(killerid,255, "Zuschlagen und abhauen");
    }
    }
    }
    else if (victimteam == 2)
    {
    if(IsPlayerConnected(killerid))
    {
    //new killer[MAX_PLAYER_NAME];
    //GetPlayerName(killerid, killer, sizeof(killer));
    // Cop kill
    PlayerInfo[playerid][pKills]--;
    if (gTeam[killerid] == 2)//cops kill cop
    {
    //format(string,128,".: Officer %s murdered Officer %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
    PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
    GivePlayerMoney(killerid, -suecost);
    GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
    }
    else
    {
    //format(string,128,".: %s murdered Officer %s (%s) :.",killer,name,deathreason);
    }
    if(gTeam[killerid] >= 5 && SafeTime[playerid] <= 0)
    {
    if(GetPlayerState(killerid) == 1)
    {
    PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills]+2;
    }
    else
    {
    PlayerInfo[killerid][pKills]++;
    }
    }
    //BroadCast(COLOR_RED, string);
    }
    }
    else if (victimteam == 3)
    {
    if(IsPlayerConnected(killerid))
    {
    //new killer[MAX_PLAYER_NAME];
    //GetPlayerName(killerid, killer, sizeof(killer));
    // Civ kill
    if ((gTeam[killerid]) == 2)//cops kill civ
    {
    if(WantedLevel[playerid] < 1)
    {
    //format(string,128,".: Officer %s murdered %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
    PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
    GivePlayerMoney(killerid, -suecost);
    GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
    }
    }
    else
    {
    //format(string,128,".: %s murdered %s (%s) :.",killer,name,deathreason);
    }
    if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason != 49)
    {
    SetPlayerCriminal(killerid,255, "Mord ersten Grades");
    }
    else if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason == 49)
    {
    SetPlayerCriminal(killerid,255, "Zuschlagen und abhauen");
    }
    //BroadCast(COLOR_RED, string);
    }
    }
    else if (victimteam == 1)
    {
    if(IsPlayerConnected(killerid))
    {
    //new killer[MAX_PLAYER_NAME];
    //GetPlayerName(killerid, killer, sizeof(killer));
    // Civ kill
    if ((gTeam[killerid]) == 2)//cops kill civ
    {
    //format(string,128,".: Officer %s murdered Paramedic %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
    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
    {
    //format(string,128,".: Paramedic %s murdered %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
    PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
    GivePlayerMoney(killerid, -suecost);
    GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
    }
    else
    {
    //format(string,128,".: %s murdered %s (%s) :.",killer,name,deathreason);
    }
    if (((gTeam[killerid]) == 4) && reason != 49)
    {
    SetPlayerCriminal(killerid,255, "Mord ersten Grades");
    }
    else if (((gTeam[killerid]) == 3) && reason == 49)
    {
    SetPlayerCriminal(killerid,255, "Zuschlagen und abhauen");
    }
    //BroadCast(COLOR_RED, string);
    }
    }
    if(lsvisum[playerid] == 1 || bsvisum[playerid] == 1)
    {
    lsvisum[playerid] = 0;
    bsvisum[playerid] = 0;
    SendClientMessage(playerid, COLOR_RED, "Deine Visen sind abgelaufen, du darfst dich jetzt in keiner anderen Stadt außer San Fierro aufhalten!");
    return 1;
    }

    if(FarmerVar[playerid] != 0)
    {
    FarmerVar[playerid] = 0;
    DisablePlayerCheckpoint(playerid);
    }
    SetPlayerColor(playerid,COLOR_GRAD2);
    TextDrawHideForPlayer(playerid,Uhr);
    killerid = INVALID_PLAYER_ID;
    if(gPlayerUsingLoopingAnim[playerid])
    {
    gPlayerUsingLoopingAnim[playerid] = 0;
    }
    return 1;
    }