/einnehmen und /flagge funktioniert nicht.

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
  • Guten Tag Breadfish,


    nach langen probieren und testen, brauche ich nun eure Hilfe. Ich habe das RGR Gangfightsystem in meinen script eingebaut und nun alles zu meinen Fraktionen/Gangs/mafien geändert und nun habe ich das Problem das wenn ich in einem Gebiet bin, das da steht Du bist in keiner gang/mafia. Ich hoffe mir kann jemand helfen.


    Die Codes
    Befehle

    Spoiler anzeigen
    if(!strcmp("/Einnehmen",cmdtext,true)){
    if(IsAFightFaction(GetPlayerFaction(playerid))){
    for(new fs;fs<sizeof(FightSystem);fs++){
    if((FightSystem[fs][fsOwnerFaction] == GetPlayerFaction(playerid) && FightSystem[fs][fsFightTime]) || FightSystem[fs][fsAttackFaction] == GetPlayerFaction(playerid))
    return SendClientMessage(playerid,FS_COL_GREY,"Deine Gang / Mafia ist bereits in einem Fight.");
    }
    new TempZone = GetPlayerFightzone(playerid);
    if(TempZone != -255){
    if(!IsAFightFaction(FightSystem[TempZone][fsOwnerFaction]))
    return SendClientMessage(playerid,FS_COL_GREY,"Gebiet wurde ausgeschaltet.");
    if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid))
    return SendClientMessage(playerid,FS_COL_GREY,"Man greift nicht seine eigenen Leute an.");
    if(FightSystem[TempZone][fsFightTime] || FightSystem[TempZone][fsAttackFaction] != -255)
    return SendClientMessage(playerid,FS_COL_GREY,"In diesem Gebiet wird bereits geschossen.");
    if(FightSystem[TempZone][fsLastFight]){
    new fsText[178];
    format(fsText,sizeof(fsText),"Ganggebiet: Dieses Ganggebiet wurde bereits Angegriffen, warte noch: '%d' Minuten.",FightSystem[TempZone][fsLastFight]);
    SendClientMessage(playerid,FS_COL_GREY,fsText);
    return 1;
    }
    for(new fs;fs<sizeof(FightSystem);fs++){
    if(FightSystem[fs][fsOwnerFaction] == FightSystem[TempZone][fsOwnerFaction] && FightSystem[fs][fsAttackFaction] != -255)
    return SendClientMessage(playerid,FS_COL_GREY,"Ganggebiet: Die Gang / Mafia der das Ganggebiet gehört hat bereits ein Kampf.");
    }
    new fsTextToOwner[255];
    format(fsTextToOwner,sizeof(fsTextToOwner),">>> Gangfightfight <<< | Ihr werden von: %s angegriffen, setzt euch zur wehr!",GetFactionNameOfFaction(GetPlayerFaction(playerid)));
    new fsName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
    new fsTextToAttack[255];
    format(fsTextToAttack,sizeof(fsTextToAttack),">>> Gangfight <<< | %s hat ein Kampf mit: %s begonnen, macht sie Platt!",fsName,GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
    new fsText[64];
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
    TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
    TextDrawSetString(FightSystem[TempZone][fsWinKills],"00 Punkte");
    format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(GetPlayerFaction(playerid)));
    TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
    TextDrawSetString(FightSystem[TempZone][fsLoseKills],"00 Punkte");
    for(new i;i<GetMaxPlayers();i++){
    if(IsPlayerConnected(i)){
    GangZoneFlashForPlayer(i,FightSystem[TempZone][fsZoneID],GetZoneColorOfFaction(GetPlayerFaction(playerid)));
    if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction]){
    PlayerPlaySound(i,1058,0.0,0.0,0.0);
    SendClientMessage(i,FS_COL_YELLOW,fsTextToOwner);
    TextDrawShowForPlayer(i,Fight);
    TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinFaction]);
    TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinKills]);
    TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseFaction]);
    TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseKills]);
    }
    if(GetPlayerFaction(i) == GetPlayerFaction(playerid)){
    PlayerPlaySound(i,1058,0.0,0.0,0.0);
    SendClientMessage(i,FS_COL_YELLOW,fsTextToAttack);
    TextDrawShowForPlayer(i,Fight);
    TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinFaction]);
    TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinKills]);
    TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseFaction]);
    TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseKills]);
    }
    }
    }
    FightSystem[TempZone][fsAttackFaction] = GetPlayerFaction(playerid);
    FightSystem[TempZone][fsKillsOfOwner] = 0;
    FightSystem[TempZone][fsKillsOfAttack] = 0;
    FightSystem[TempZone][fsFightTime] = FIGHT_TIME;
    FightSystem[TempZone][fsCtfOfOwner][0] = -255;
    FightSystem[TempZone][fsCtfOfOwner][1] = 0;
    FightSystem[TempZone][fsCtfOfAttack][0] = -255;
    FightSystem[TempZone][fsCtfOfAttack][1] = 0;
    return 1;
    }return SendClientMessage(playerid,FS_COL_GREY,"Du bist in keinem Gebiet!");
    }else SendClientMessage(playerid,FS_COL_GREY,"Du bist in keiner Gang / Mafia.");
    return 1;
    }
    if(!strcmp("/Flagge",cmdtext,true)){
    if(IsAFightFaction(GetPlayerFaction(playerid))){
    new TempZone = GetPlayerFightzone(playerid);
    if(TempZone != -255){
    if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
    return SendClientMessage(playerid,FS_COL_GREY,"Du darfst das nur zu Fuß machen ...");
    if(FightSystem[TempZone][fsAttackFaction] == -255 || !FightSystem[TempZone][fsFightTime])
    return SendClientMessage(playerid,FS_COL_GREY,"Hier gibt es nichts zu erobern.");
    if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid)){
    if(IsPlayerInRangeOfPoint(playerid,5.0,FightSystem[TempZone][fsCtfOfAttackx],FightSystem[TempZone][fsCtfOfAttacky],FightSystem[TempZone][fsCtfOfAttackz])){
    if(FightSystem[TempZone][fsCtfOfAttack][0] != -255)
    return SendClientMessage(playerid,FS_COL_GREY,"Deine Gang / Mafia erobert bereits die Flagge!");
    FightSystem[TempZone][fsCtfOfAttack][1] = 0;
    FightSystem[TempZone][fsCtfOfAttack][0] = playerid;
    AttachObjectToPlayer(FightSystem[TempZone][fsFlagOfAttack],playerid,0.0,0.0,0.0,0.0,0.0,0.0);
    new fsName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
    new fsText[128];
    format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge aufgehoben!",fsName);
    for(new i;i<MAX_PLAYERS;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);
    }
    }
    }
    }else SendClientMessage(playerid,FS_COL_GREY,"Du bist nicht in der nähe der Flagge!");
    }
    else if(FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid)){
    if(IsPlayerInRangeOfPoint(playerid,5.0,FightSystem[TempZone][fsCtfOfOwnerx],FightSystem[TempZone][fsCtfOfOwnery],FightSystem[TempZone][fsCtfOfOwnerz])){
    if(FightSystem[TempZone][fsCtfOfOwner][0] != -255)
    return SendClientMessage(playerid,FS_COL_GREY,"Deine Gang / Mafia erobert bereits die Flagge!");
    FightSystem[TempZone][fsCtfOfOwner][1] = 0;
    FightSystem[TempZone][fsCtfOfOwner][0] = playerid;
    AttachObjectToPlayer(FightSystem[TempZone][fsFlagOfOwner],playerid,0.0,0.0,0.0,0.0,0.0,0.0);
    new fsName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
    new fsText[128];
    format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge aufgehoben!",fsName);
    for(new i;i<MAX_PLAYERS;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);
    }
    }
    }
    }else SendClientMessage(playerid,FS_COL_GREY,"Du bist nicht in der nähe der Flagge!");
    }else SendClientMessage(playerid,FS_COL_GREY,"Du bist nicht in diesem Fight verwickelt ...");
    }else SendClientMessage(playerid,FS_COL_GREY,"Du bist in keinem Gebiet!");
    }else SendClientMessage(playerid,FS_COL_GREY,"Du bist in keiner Gang / Mafia.");
    return 1;
    }


    Stocks

    Spoiler anzeigen
    stock GetPlayerFightzone(playerid){
    new Float:GangZone[3];
    GetPlayerPos(playerid,GangZone[0],GangZone[1],GangZone[2]);
    for(new fs;fs<sizeof(FightSystem);fs++){
    if((GangZone[0] >= FightSystem[fs][fsMinX] && GangZone[0] <= FightSystem[fs][fsMaxX]) && (GangZone[1] >= FightSystem[fs][fsMinY] && GangZone[1] <= FightSystem[fs][fsMaxY]) && GangZone[2] <= 500)
    return fs;
    }return -255;
    }
    stock IsAFightFaction(Faction){
    if(Faction == 5) return true;
    if(Faction == 6) return true;
    if(Faction == 12) return true;
    if(Faction == 13) return true;
    if(Faction == 14) return true;
    if(Faction == 15) return true;
    if(Faction == 16) return true;
    if(Faction == 17) return true;
    if(Faction == 18) return true;
    if(Faction == 19) return true;
    if(Faction == 23) return true;
    return false;
    }
    stock GetZoneColorOfFaction(Faction){
    if(Faction == 5) return 0xFFFFFFFF;
    else if(Faction == 6) return 0x330000AA;
    else if(Faction == 12) return 0x7D0000FF;
    else if(Faction == 13) return 0x004200AA;
    else if(Faction == 14) return 0x990099AA;
    else if(Faction == 15) return 0xCC0000AA;
    else if(Faction == 16) return 0xCC77E8AA;
    else if(Faction == 17) return 0x00FFFFFF;
    else if(Faction == 18) return 0x3200FFFF;
    else if(Faction == 19) return 0x520000FF;
    else if(Faction == 23) return 0x8C8C8CFF;
    else return 0xFAFAFAFF;//NoN-Gang
    }
    stock GetFactionNameOfFaction(Faction){
    new FactionName[64];
    if(Faction == 5) format(FactionName,sizeof(FactionName),"La Cosa Nostra");
    else if(Faction == 6) format(FactionName,sizeof(FactionName),"Yakuza");
    else if(Faction == 12) format(FactionName,sizeof(FactionName),"Red Soldier");//hells Angel
    else if(Faction == 13) format(FactionName,sizeof(FactionName),"Grove Street");
    else if(Faction == 14) format(FactionName,sizeof(FactionName),"Ballas");
    else if(Faction == 15) format(FactionName,sizeof(FactionName),"BloodZ");//2f2f
    else if(Faction == 16) format(FactionName,sizeof(FactionName),"Vagos");
    else if(Faction == 17) format(FactionName,sizeof(FactionName),"Aztecas");
    else if(Faction == 18) format(FactionName,sizeof(FactionName),"S.F Rifa");
    else if(Faction == 19) format(FactionName,sizeof(FactionName),"West Coast Customs");
    else if(Faction == 23) format(FactionName,sizeof(FactionName),"Russen Mafia");
    else format(FactionName,sizeof(FactionName),"NoN-Gang");
    return FactionName;
    }
    stock GetPlayerFaction(playerid){
    new Member = CallRemoteFunction("GetPlayerMember","i",playerid);
    if(Member)
    return Member;
    new Leader = CallRemoteFunction("GetPlayerLeader","i",playerid);
    if(Leader)
    return Leader;
    return 0;
    }


    Die Publics


    Spoiler anzeigen
    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;
    }
    public FightUpdate_2(){
    for(new fs;fs<sizeof(FightSystem);fs++){
    if(FightSystem[fs][fsFightTime]){
    FightSystem[fs][fsFightTime]--;
    if(!FightSystem[fs][fsFightTime]){
    FightSystem[fs][fsLastFight] = FIGHT_WAIT_TIME;
    new fsTextToOwner[255];
    new fsTextToAttack[255];
    new fsType;
    if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
    fsType = 2;
    format(fsTextToOwner,sizeof(fsTextToOwner),">>> Gangfight <<< | Ihr habt gewonnen...");
    format(fsTextToAttack,sizeof(fsTextToAttack),">>> Gangfight <<< | Ihr habt verloren...");
    }
    else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
    fsType = 3;
    format(fsTextToOwner,sizeof(fsTextToOwner),">>> Gangfight <<< | Ihr habt verloren...");
    format(fsTextToAttack,sizeof(fsTextToAttack),">>> Gangfight <<< | Ihr habt gewonnen...");
    }else{
    fsType = 1;
    format(fsTextToOwner,sizeof(fsTextToOwner),">>> Gangfight <<< | Unentschieden, ihr behaltet euer gebiet.");
    format(fsTextToAttack,sizeof(fsTextToAttack),">>> Gangfight <<< | Unentschieden, ihr müsst euch mehr anstrengen.");
    }
    for(new i;i<GetMaxPlayers();i++){
    if(IsPlayerConnected(i)){
    GangZoneStopFlashForPlayer(i,FightSystem[fs][fsZoneID]);
    if(fsType == 3){
    GangZoneHideForPlayer(i,FightSystem[fs][fsZoneID]);
    GangZoneShowForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsAttackFaction]));
    }
    if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction]){
    PlayerPlaySound(i,1058,0.0,0.0,0.0);
    TextDrawHideForPlayer(i,Fight);
    TextDrawHideForPlayer(i,FightSystem[fs][fsWinFaction]);
    TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
    TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
    TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
    SendClientMessage(i,FS_COL_YELLOW,fsTextToOwner);
    if(fsType == 3 && GetPlayerFightzone(i) == fs)
    SetPlayerHealth(i,0.0);
    }
    else if(GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
    PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
    TextDrawHideForPlayer(i,Fight);
    TextDrawHideForPlayer(i,FightSystem[fs][fsWinFaction]);
    TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
    TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
    TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
    SendClientMessage(i,FS_COL_YELLOW,fsTextToAttack);
    if(fsType != 3 && GetPlayerFightzone(i) == fs)
    SetPlayerHealth(i,0.0);
    }
    }
    }
    FightSystem[fs][fsKillsOfAttack] = 0;
    FightSystem[fs][fsKillsOfOwner] = 0;
    if(fsType == 3)
    FightSystem[fs][fsOwnerFaction] = FightSystem[fs][fsAttackFaction];
    FightSystem[fs][fsAttackFaction] = -255;
    if(FightSystem[fs][fsCtfOfOwner][0] != -255){
    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){
    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;
    }
    }
    if(FightSystem[fs][fsLastFight])
    FightSystem[fs][fsLastFight]--;
    }return 1;
    }
    public Fight_Init(){
    Fight = TextDrawCreate(241.000000,351.000000,"Gangfight:");
    TextDrawAlignment(Fight,0);
    TextDrawBackgroundColor(Fight,0x000000ff);
    TextDrawFont(Fight,0);
    TextDrawLetterSize(Fight,1.200000,1.500000);
    TextDrawColor(Fight,0xffffffff);
    TextDrawSetOutline(Fight,1);
    TextDrawSetProportional(Fight,1);
    TextDrawSetShadow(Fight,1);
    if(!fexist(FIGHT_FILE)){
    new File:fFile=fopen(FIGHT_FILE,io_write);
    for(new fs;fs<sizeof(FightSystem);fs++)
    fwrite(fFile,"15 -255 0 0 0\r\n");
    fclose(fFile);
    }
    new File:fFile=fopen(FIGHT_FILE,io_read),Content[64],fs;
    while(fread(fFile,Content) && fs < sizeof(FightSystem)){
    FightSystem[fs][fsWinFaction] = TextDrawCreate(206.000000,379.000000," ");
    TextDrawAlignment(FightSystem[fs][fsWinFaction],0);
    TextDrawBackgroundColor(FightSystem[fs][fsWinFaction],0x000000ff);
    TextDrawFont(FightSystem[fs][fsWinFaction],0);
    TextDrawLetterSize(FightSystem[fs][fsWinFaction],0.899999,1.300000);
    TextDrawColor(FightSystem[fs][fsWinFaction],0xffffffff);
    TextDrawSetShadow(FightSystem[fs][fsWinFaction],1);
    TextDrawSetOutline(FightSystem[fs][fsWinFaction],1);
    TextDrawSetProportional(FightSystem[fs][fsWinFaction],1);
    FightSystem[fs][fsLoseFaction] = TextDrawCreate(206.000000,400.000000," ");
    TextDrawAlignment(FightSystem[fs][fsLoseFaction],0);
    TextDrawBackgroundColor(FightSystem[fs][fsLoseFaction],0x000000ff);
    TextDrawFont(FightSystem[fs][fsLoseFaction],0);
    TextDrawLetterSize(FightSystem[fs][fsLoseFaction],0.799999,1.300000);
    TextDrawColor(FightSystem[fs][fsLoseFaction],0xffffffff);
    TextDrawSetShadow(FightSystem[fs][fsLoseFaction],1);
    TextDrawSetOutline(FightSystem[fs][fsLoseFaction],1);
    TextDrawSetProportional(FightSystem[fs][fsLoseFaction],1);
    FightSystem[fs][fsWinKills] = TextDrawCreate(328.000000,379.000000," ");
    TextDrawAlignment(FightSystem[fs][fsWinKills],0);
    TextDrawBackgroundColor(FightSystem[fs][fsWinKills],0x000000ff);
    TextDrawFont(FightSystem[fs][fsWinKills],0);
    TextDrawLetterSize(FightSystem[fs][fsWinKills],0.599999,1.200000);
    TextDrawColor(FightSystem[fs][fsWinKills],0xffffffff);
    TextDrawSetShadow(FightSystem[fs][fsWinKills],1);
    TextDrawSetOutline(FightSystem[fs][fsWinKills],1);
    TextDrawSetProportional(FightSystem[fs][fsWinKills],1);
    FightSystem[fs][fsLoseKills] = TextDrawCreate(328.000000,400.000000," ");
    TextDrawAlignment(FightSystem[fs][fsLoseKills],0);
    TextDrawBackgroundColor(FightSystem[fs][fsLoseKills],0x000000ff);
    TextDrawFont(FightSystem[fs][fsLoseKills],0);
    TextDrawLetterSize(FightSystem[fs][fsLoseKills],0.599999,1.300000);
    TextDrawColor(FightSystem[fs][fsLoseKills],0xffffffff);
    TextDrawSetShadow(FightSystem[fs][fsLoseKills],1);
    TextDrawSetOutline(FightSystem[fs][fsLoseKills],1);
    TextDrawSetProportional(FightSystem[fs][fsLoseKills],1);
    StripNewLine(Content);
    sscanf(Content,"dddddd",FightSystem[fs][fsOwnerFaction],FightSystem[fs][fsAttackFaction],FightSystem[fs][fsKillsOfOwner],FightSystem[fs][fsKillsOfAttack],FightSystem[fs][fsFightTime],FightSystem[fs][fsLastFight]);
    FightSystem[fs][fsCtfOfOwner][0] = -255;
    FightSystem[fs][fsCtfOfOwner][1] = 0;
    FightSystem[fs][fsCtfOfAttack][0] = -255;
    FightSystem[fs][fsCtfOfAttack][1] = 0;
    FightSystem[fs][fsZoneID] = GangZoneCreate(FightSystem[fs][fsMinX],FightSystem[fs][fsMinY],FightSystem[fs][fsMaxX],FightSystem[fs][fsMaxY]);
    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][fsFlagOfAttack] = CreateObject(2993,FightSystem[fs][fsCtfOfAttackx],FightSystem[fs][fsCtfOfAttacky],(FightSystem[fs][fsCtfOfAttackz]-1.0),0.0,0.0,0.0,150.0);
    if(FightSystem[fs][fsFightTime] && FightSystem[fs][fsAttackFaction] != -255){
    new fsText[64];
    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),"%02d 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);
    }
    }
    for(new i;i<GetMaxPlayers();i++){
    if(IsPlayerConnected(i)){
    SetPVarInt(i,"Spawned",1);
    GangZoneShowForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsOwnerFaction]));
    if(FightSystem[fs][fsAttackFaction] != -255 && FightSystem[fs][fsFightTime]){
    GangZoneFlashForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsAttackFaction]));
    if(GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction] || GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction]){
    TextDrawShowForPlayer(i,Fight);
    TextDrawShowForPlayer(i,FightSystem[fs][fsWinFaction]);
    TextDrawShowForPlayer(i,FightSystem[fs][fsLoseFaction]);
    TextDrawShowForPlayer(i,FightSystem[fs][fsWinKills]);
    TextDrawShowForPlayer(i,FightSystem[fs][fsLoseKills]);
    }
    }
    }
    }fs++;
    }
    fclose(fFile);
    FightTimer[0] = SetTimer("FightUpdate_1",1003,true);
    FightTimer[1] = SetTimer("FightUpdate_2",60017,true);
    }
    public Fight_Close(){
    KillTimer(FightTimer[0]);
    KillTimer(FightTimer[1]);
    for(new i;i<GetMaxPlayers();i++){
    if(IsPlayerConnected(i))
    DeletePVar(i,"Spawned");
    }
    new File:fFile=fopen(FIGHT_FILE,io_write),Content[64];
    for(new fs;fs<sizeof(FightSystem);fs++){
    TextDrawDestroy(FightSystem[fs][fsWinFaction]);
    TextDrawDestroy(FightSystem[fs][fsLoseFaction]);
    TextDrawDestroy(FightSystem[fs][fsWinKills]);
    TextDrawDestroy(FightSystem[fs][fsLoseKills]);
    GangZoneDestroy(FightSystem[fs][fsZoneID]);
    DestroyObject(FightSystem[fs][fsFlagOfOwner]);
    DestroyObject(FightSystem[fs][fsFlagOfAttack]);
    format(Content,sizeof(Content),"%d %d %d %d %d %d\r\n",FightSystem[fs][fsOwnerFaction],FightSystem[fs][fsAttackFaction],FightSystem[fs][fsKillsOfOwner],FightSystem[fs][fsKillsOfAttack],FightSystem[fs][fsFightTime],FightSystem[fs][fsLastFight]);
    fwrite(fFile,Content);
    }
    fclose(fFile);
    TextDrawDestroy(Fight);
    return 1;
    }


    Falls ihr noch mehr Zeilen braucht, schreibt es. Ich habe keine Errors bekommen!! ICh freue mich über jede Antwort :D


    MFg
    TRoniix

    Projekt:


    German CrimeLife Testserver: 5.62.71.62:7777

  • Ich habe das RGR Gangfightsystem in meinen script eingebaut und nun alles zu meinen Fraktionen/Gangs/mafien geändert und nun habe ich das Problem das wenn ich in einem Gebiet bin, das da steht Du bist in keiner gang/mafia


    Ja...und wieso ist das wohl nicht so? :rolleyes:


    Schön das du ein System aus einem Script in deins Kopieren kannst...allerdings solltest du vielleicht erstmal versuchen zu verstehen, was dieser Code da macht...


    Schau dir mal diese Funktion an:


    stock GetPlayerFaction(playerid){
    new Member = CallRemoteFunction("GetPlayerMember","i",playerid);
    if(Member) return Member;
    new Leader = CallRemoteFunction("GetPlayerLeader","i",playerid);
    if(Leader) return Leader;
    return 0;
    }


    Da liegt dein Fehler, den solltest du sehen... :rolleyes:


    &amp;amp;quot;Noch ein Tipp&amp;amp;quot;
    GetPlayerMember bzw GetPlayerLeader...sind vielleicht nicht die Abfragen für dein Script für die Fraktion...solltest du vielleicht ersetzen :whistling: 


    PS: Man macht sowas nicht...1000 Zeilen Code dahin klatschen, sagen dass man es kopiert hat und dann fragen, wieso es nicht in seinem Script funktioniert! :pinch:


    mfg. :rolleyes:

    ast2ufdyxkb1.png


    Leute, lernt scripten und versucht mal lieber etwas selber zu schreiben, als es aus einem GF zu kopieren. :S

  • Danke für die schnelle Antwort


    Also ich habe mir nochmal das fs angeguckt und habe in der Beschreibung wo ich das her habe. Dies gefunden return PlayerInfo[playerid][pMember];


    Dies sehe dann so aus bei mir:


    stock GetPlayerFaction(playerid){
    new Member = CallRemoteFunction("GetPlayerMember","i",playerid);
    if(Member)
    return PlayerInfo[playerid][pMember];
    return Member;
    new Leader = CallRemoteFunction("GetPlayerLeader","i",playerid);
    if(Leader)
    return PlayerInfo[playerid][pLeader];
    return Leader;
    return 0;
    }


    Habe es auch schon so probiert
    stock GetPlayerFaction(playerid){
    new Member = CallRemoteFunction("GetPlayerMember","i",playerid);
    if(Member)
    return PlayerInfo[playerid][15];
    return Member;
    new Leader = CallRemoteFunction("GetPlayerLeader","i",playerid);
    if(Leader)
    return PlayerInfo[playerid][15];
    return Leader;
    return 0;
    }


    Hier ist nochmal der Thread und der Kommentar wo ich diesen tipp gefunden habe
    [ FILTERSCRIPT ] RGR Gangfight by [My]Kevin [All Versions 1 - 3]


    Dafür sind die Funktionen da!
    GetPlayerLeader(playerid)
    GetPlayerMember(playerid)


    Diese funktionen müssen in deinem Script eingebaut werden...
    Immer die Fraktionsid returnen!


    return PlayerInfo[playerid][pMember];


    Nur ich weiß nicht genau wie ich das returnen soll. Ich hoffe mir kann jemand helfen.


    MFG
    Troniix :S

    Projekt:


    German CrimeLife Testserver: 5.62.71.62:7777

    2 Mal editiert, zuletzt von SKz () aus folgendem Grund: Kleine Lösung und Link hinzugefügt