Gangfight Problem

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
  • Bei der Flaggenabgabe läuft der timer zu schnell als in Sekunden...


    Kann wer helfen :O ?


    public FightUpdate_1(){
    for(new fs;fs<sizeof(FightSystem);fs++){
    if(FightSystem[fs][fsFightTime] && FightSystem[fs][fsAttackFaction] != -255){
    new fsText[128];
    if(FightSystem[fs][fsCtfOfOwner][0] != -255){
    if(IsPlayerConnected(FightSystem[fs][fsCtfOfOwner][0])){
    if(GetPlayerFightzone(FightSystem[fs][fsCtfOfOwner][0]) == fs){
    if(IsPlayerInRangeOfPoint(FightSystem[fs][fsCtfOfOwner][0],5.0,FightSystem[fs][fsCtfOfAttackx],FightSystem[fs][fsCtfOfAttacky],FightSystem[fs][fsCtfOfAttackz])){
    FightSystem[fs][fsCtfOfOwner][1]++;
    format(fsText,sizeof(fsText),"~n~~n~~n~~w~Abgegeben in:~n~~r~%d ~w~Sekunden",(60-FightSystem[fs][fsCtfOfOwner][1]));
    GameTextForPlayer(FightSystem[fs][fsCtfOfOwner][0],fsText,1250,3);
    if(FightSystem[fs][fsCtfOfOwner][1] > 60){
    DestroyObject(FightSystem[fs][fsFlagOfOwner]);
    FightSystem[fs][fsFlagOfOwner] = CreateObject(2993,FightSystem[fs][fsCtfOfOwnerx],FightSystem[fs][fsCtfOfOwnery],(FightSystem[fs][fsCtfOfOwnerz]-1.0),0.0,0.0,0.0,150.0);
    new fsName[MAX_PLAYER_NAME];
    GetPlayerName(FightSystem[fs][fsCtfOfOwner][0],fsName,MAX_PLAYER_NAME);
    format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge abgegeben!",fsName);
    for(new i;i<GetMaxPlayers();i++){
    if(IsPlayerConnected(i)){
    if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
    PlayerPlaySound(i,1058,0.0,0.0,0.0);
    SendClientMessage(i,FS_COL_YELLOW,fsText);
    }
    }
    }
    FightSystem[fs][fsCtfOfOwner][0] = -255;
    FightSystem[fs][fsCtfOfOwner][1] = 0;
    FightSystem[fs][fsKillsOfAttack]++;
    if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
    TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
    TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
    }
    else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
    TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%d Punkte",FightSystem[fs][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
    TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
    }else{
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
    TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
    TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
    }
    }
    }
    }
    else
    {
    new fsName[MAX_PLAYER_NAME];
    GetPlayerName(FightSystem[fs][fsCtfOfOwner][0],fsName,MAX_PLAYER_NAME);
    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[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
    PlayerPlaySound(i,1058,0.0,0.0,0.0);
    SendClientMessage(i,FS_COL_YELLOW,fsText);
    }
    }
    }
    DestroyObject(FightSystem[fs][fsFlagOfOwner]);
    FightSystem[fs][fsFlagOfOwner] = CreateObject(2993,FightSystem[fs][fsCtfOfOwnerx],FightSystem[fs][fsCtfOfOwnery],(FightSystem[fs][fsCtfOfOwnerz]-1.0),0.0,0.0,0.0,150.0);
    FightSystem[fs][fsCtfOfOwner][0] = -255;
    FightSystem[fs][fsCtfOfOwner][1] = 0;
    }
    }
    }
    if(FightSystem[fs][fsCtfOfAttack][0] != -255){
    if(IsPlayerConnected(FightSystem[fs][fsCtfOfAttack][0])){
    if(GetPlayerFightzone(FightSystem[fs][fsCtfOfAttack][0]) == fs){
    if(IsPlayerInRangeOfPoint(FightSystem[fs][fsCtfOfAttack][0],5.0,FightSystem[fs][fsCtfOfOwnerx],FightSystem[fs][fsCtfOfOwnery],FightSystem[fs][fsCtfOfOwnerz])){
    FightSystem[fs][fsCtfOfAttack][1]++;
    format(fsText,sizeof(fsText),"~n~~n~~n~~w~Abgegeben in:~n~~r~%d ~w~Sekunden",(60-FightSystem[fs][fsCtfOfAttack][1]));
    GameTextForPlayer(FightSystem[fs][fsCtfOfAttack][0],fsText,1250,3);
    if(FightSystem[fs][fsCtfOfAttack][1] > 60){
    DestroyObject(FightSystem[fs][fsFlagOfAttack]);
    FightSystem[fs][fsFlagOfAttack] = CreateObject(2993,FightSystem[fs][fsCtfOfAttackx],FightSystem[fs][fsCtfOfAttacky],(FightSystem[fs][fsCtfOfAttackz]-1.0),0.0,0.0,0.0,150.0);
    new fsName[MAX_PLAYER_NAME];
    GetPlayerName(FightSystem[fs][fsCtfOfAttack][0],fsName,MAX_PLAYER_NAME);
    format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge abgegeben!",fsName);
    for(new i;i<GetMaxPlayers();i++){
    if(IsPlayerConnected(i)){
    if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
    PlayerPlaySound(i,1058,0.0,0.0,0.0);
    SendClientMessage(i,FS_COL_YELLOW,fsText);
    }
    }
    }
    FightSystem[fs][fsCtfOfAttack][0] = -255;
    FightSystem[fs][fsCtfOfAttack][1] = 0;
    FightSystem[fs][fsKillsOfOwner]++;
    if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
    TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
    TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
    }
    else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
    TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%d Punkte",FightSystem[fs][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
    TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
    }else{
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
    TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
    TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
    TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
    format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
    TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
    }
    }
    }
    }
    else
    {
    new fsName[MAX_PLAYER_NAME];
    GetPlayerName(FightSystem[fs][fsCtfOfAttack][0],fsName,MAX_PLAYER_NAME);
    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[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
    PlayerPlaySound(i,1058,0.0,0.0,0.0);
    SendClientMessage(i,FS_COL_YELLOW,fsText);
    }
    }
    }
    DestroyObject(FightSystem[fs][fsFlagOfAttack]);
    FightSystem[fs][fsFlagOfAttack] = CreateObject(2993,FightSystem[fs][fsCtfOfAttackx],FightSystem[fs][fsCtfOfAttacky],(FightSystem[fs][fsCtfOfAttackz]-1.0),0.0,0.0,0.0,150.0);
    FightSystem[fs][fsCtfOfAttack][0] = -255;
    FightSystem[fs][fsCtfOfAttack][1] = 0;
    }
    }
    }
    }
    }return 1;
    }

    Einmal editiert, zuletzt von CengizHan ()