Brauche dringend Hilfe (Nach dem Tod Funktion)

  • Hallo Breadfish


    Bei mir ist es so das manche Fraktionen als FightFactions gennant sind. Das sind die Fraktionen die z.B Gangfight starten können.



    stock IsAFightFaction(Faction){
    if(Faction == 5 || Faction == 6 || Faction == 13 || Faction == 14 || Faction == 16 || Faction == 17 || Faction == 23 || Faction == 25 || Faction == 12)
    return 1;
    return 0;
    }


    Eine FightFaction wird halt nicht als eine Normale Fraktion gelesen sondern als eine Fraktion die Gangfight starten kann.
    Nach dem Tod spawnt man direkt in der Base aber die Normale Fraktionen spawnen nach dem Tod im Krankenhaus.
    Das Problem ist das es genau so mit Wanteds ist. Die Fightfactions spawnen direkt in der Base nach und nicht im Knast. Aber die Normale Fraktionen spawnen im Knast.
    Wenn man in einem Gebiet als FightFaction stirbt spawnt man normal im Krankenhaus und mit wanteds genauso im Knast aber nur wenn man sich im Gebiet befindet
    auch wenn kein Gangfight gestartet wurde.


    Die Todes Funktion:



    if(PlayerInfo[playerid][pTot] == 1) //Nach dem Tod
    {
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_GREEN, "Du bist gestorben ");
    SendClientMessage(playerid, COLOR_WHITE, "Du bist im Krankenhaus");
    SendClientMessage(playerid, COLOR_WHITE, "In 120 Sekunden spawnst du wieder");
    SetPlayerHealth(playerid, 100);
    FreezePlayer(playerid);
    SetPlayerPos(playerid,x,y,z);
    SetPlayerCameraPos(playerid,x,y,z);
    SetPlayerCameraLookAt(playerid,x,y,z);
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    ResetPlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0);


    return 1;
    }


    Es gibt eine OnPlayerDeath Funktion aber auch eine GW_OnPlayerDeath



    Function OnPlayerDeath(playerid, killerid, reason)
    {
    M_OnPlayerDeath(playerid,killerid,reason);
    GW_OnPlayerDeath(playerid, killerid, reason); [b]<----- Wenn ich das von hier lösche dann werden die Punkte bei Gangfight nicht gezählt[/b]
    SendDeathMessage(killerid, playerid, reason);
    }



    forward GW_OnPlayerDeath(playerid, killerid, reason);
    public GW_OnPlayerDeath(playerid, killerid, reason){
    if(IsAFightFaction(GetPlayerFaction(playerid))){
    new TempZone = GetPlayerFightzone(playerid);
    if(FightSystem[TempZone][fsAttackFaction] != -255 && FightSystem[TempZone][fsFightTime]){
    if(FightSystem[TempZone][fsCtfOfOwner][0] == playerid){
    new fsName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
    new fsText[128];
    format(fsText,sizeof(fsText),">>> GANGFIGHT <<< | %s hat die Flagge fallen gelassen!",fsName);
    for(new i;i<GetMaxPlayers();i++){
    if(IsPlayerConnected(i)){
    if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[TempZone][fsAttackFaction]){
    PlayerPlaySound(i,1058,0.0,0.0,0.0);
    SendClientMessage(i,FS_COL_YELLOW,fsText);
    }
    }
    }
    DestroyObject(FightSystem[TempZone][fsFlagOfOwner]);
    /*FightSystem[TempZone][fsFlagOfOwner] = CreateObject(2993,FightSystem[TempZone][fsCtfOfOwnerx],FightSystem[TempZone][fsCtfOfOwnery],(FightSystem[TempZone][fsCtfOfOwnerz]-1.0),0.0,0.0,0.0,150.0);*/
    FightSystem[TempZone][fsCtfOfOwner][0] = -255;
    FightSystem[TempZone][fsCtfOfOwner][1] = 0;
    }
    else if(FightSystem[TempZone][fsCtfOfAttack][0] == playerid){
    new fsName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
    new fsText[128];
    format(fsText,sizeof(fsText),">>> GANGFIGHT <<< | %s hat die Flagge fallen gelassen!",fsName);
    for(new i;i<GetMaxPlayers();i++){
    if(IsPlayerConnected(i)){
    if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[TempZone][fsAttackFaction]){
    PlayerPlaySound(i,1058,0.0,0.0,0.0);
    SendClientMessage(i,FS_COL_YELLOW,fsText);
    }
    }
    }
    DestroyObject(FightSystem[TempZone][fsFlagOfAttack]);
    /*FightSystem[TempZone][fsFlagOfAttack] = CreateObject(2993,FightSystem[TempZone][fsCtfOfAttackx],FightSystem[TempZone][fsCtfOfAttacky],(FightSystem[TempZone][fsCtfOfAttackz]-1.0),0.0,0.0,0.0,150.0);*/
    FightSystem[TempZone][fsCtfOfAttack][0] = -255;
    FightSystem[TempZone][fsCtfOfAttack][1] = 0;
    }
    }
    }
    if(IsPlayerConnected(killerid)){
    if(IsAFightFaction(GetPlayerFaction(killerid))){
    new TempZone = GetPlayerFightzone(killerid);
    if(TempZone != -255){
    if(FightSystem[TempZone][fsFightTime] && FightSystem[TempZone][fsAttackFaction] != -255){
    if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(killerid) || FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(killerid)){
    if(IsAFightFaction(GetPlayerFaction(playerid))){
    new fsText[64];
    if(FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(killerid) && FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid)){
    PlayerPlaySound(killerid,1084,0.0,0.0,0.0);
    GivePlayerMoney(killerid,500);
    GameTextForPlayer(killerid,"~g~GANGFIGHTKILL",3125,3);
    GameTextForPlayer(playerid,"~r~GANGFIGHTDEATH",3125,3);
    FightSystem[TempZone][fsKillsOfAttack]++;
    if(FightSystem[TempZone][fsKillsOfOwner] > FightSystem[TempZone][fsKillsOfAttack]){
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
    TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
    TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
    }
    else if(FightSystem[TempZone][fsKillsOfAttack] > FightSystem[TempZone][fsKillsOfOwner]){
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
    TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
    TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
    }else{
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
    TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
    TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
    }
    }
    else if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(killerid) && FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid)){
    PlayerPlaySound(killerid,1084,0.0,0.0,0.0);
    GameTextForPlayer(killerid,"~g~GANGFIGHTKILL",3125,3);
    GameTextForPlayer(playerid,"~r~GANGFIGHTDEATH",3125,3);
    FightSystem[TempZone][fsKillsOfOwner]++;
    if(FightSystem[TempZone][fsKillsOfOwner] > FightSystem[TempZone][fsKillsOfAttack]){
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
    TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
    TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
    }
    else if(FightSystem[TempZone][fsKillsOfAttack] > FightSystem[TempZone][fsKillsOfOwner]){
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
    TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
    TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
    }else{
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
    TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
    TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%d",FightSystem[TempZone][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
    }
    }
    }
    }
    }
    }
    }
    }return 1;
    }


    MFG


    Ich werde sehr dankbar sein wenn mir jemand helfen kann.