/makeleader 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
  • Hallo,


    Immer wenn ich /makeleader eingebe
    stürzt der server manchmal ab.




    if(strcmp(cmd, "/makeleader", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "NUTZE: /makeleader [playerid/Name] [Nummer(1-27)]");
    SendClientMessage(playerid, COLOR_WHITE, "LSPD = 1 || SFPD = 2 || Us. Army = 3 || Notrufzentrale = 4 || La Cosa Nostra = 5");
    SendClientMessage(playerid, COLOR_WHITE, "Yakuza = 6 || Bürgermeister = 7 || Hitman Agency = 8 || SAN News = 9 || M18 = 10");
    SendClientMessage(playerid, COLOR_WHITE, "Fahrschule = 11 || Hells Angels = 12 || Groove Street = 13 || Ballas = 14");
    SendClientMessage(playerid, COLOR_WHITE, "Red Soldiers = 15 || Los Santos Vagos = 16 || Varrios Los Aztecas = 17");
    SendClientMessage(playerid, COLOR_WHITE, "Withe fate = 18 || Brigada = 19|| Terroristen = 20 || FBI = 21");
    SendClientMessage(playerid, COLOR_WHITE, "Triaden = 22 || Wheelman Agency = 23|| Ordnungsamt = 24 || Biker BoyZ = 25 || Vice News = 26");
    return 1;
    }
    new para1;
    new level;
    para1 = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    level = strval(tmp);
    if(level > 27 || level < 0)
    {
    SendClientMessage(playerid, COLOR_GREY, "0 = Zivi, 27 = Letzte Fraktion");
    return 1;
    }
    if (PlayerInfo[playerid][pAdmin] >= 7)
    {
    if(IsPlayerConnected(para1))
    {
    if(para1 != INVALID_PLAYER_ID)
    {
    if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieser Player ist bereits/noch in einer Fraktion!");
    return 1;
    }
    if(PlayerInfo[para1][pFrakSperre] > 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler hat FraktionsSperre!");
    return 1;
    }
    new ftext[32];
    if(level == 0) { ftext = "Zivilisten"; } else { ftext = Fracs[(level-1)]; }
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), " Du hast %s die Leaderrechte der Fraktion %s gegeben.", giveplayer,ftext);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), " Admin %s hat dich zum Leader von der Fraktion %s ernannt.", sendername,ftext);
    SendClientMessage(para1, COLOR_LIGHTBLUE, string);
    SendClientMessage(para1, COLOR_GRAD5, " Du kannst mit /help deine neuen Fraktionsbefehle betrachten");
    SendClientMessage(para1, COLOR_GRAD5, " Vergiss nicht: Du hast nun 4 Wochen Pflicht Leader in dieser Fraktion zu bleiben!");
    SendClientMessage(para1, COLOR_GRAD5, " Wenn du vor Ablauf der Frist rausgeworfen wirst, musst du die Rest der Zeit Zivilist bleiben.");
    // gTeam[para1] = 0;
    PlayerInfo[para1][pTeam] = 0;
    PlayerInfo[para1][pRank] = 10;
    PlayerInfo[para1][pLeader] = level;
    new iyear, imonth,iday;
    getdate(iyear, imonth, iday);
    format(string, sizeof(string), "%s[Level:%d] wurde von %s Als Leader der Fraktion %s eingeladen (%d-%d-%d)", giveplayer,PlayerInfo[para1][pLevel],sendername,ftext,imonth,iday,iyear);
    LeaderLog(string);
    if(level == 0)
    {
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
    PlayerInfo[para1][pMember] = 0;
    PlayerInfo[para1][pRank] = 0;
    PlayerInfo[para1][pChar] = 0;
    new rand = random(sizeof(CIV));
    SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
    PlayerInfo[para1][pModel] = CIV[rand];
    MedicBill[para1] = 0;
    SpawnPlayer(para1);
    }
    else if(level == 1) { PlayerInfo[para1][pChar] = 283; gTeam[para1] = 2; PlayerInfo[para1][pTeam] = 2; } // LOS SANTOS POLICE
    else if(level == 2) { PlayerInfo[para1][pChar] = 288; gTeam[para1] = 2; PlayerInfo[para1][pTeam] = 2; } // SAN FIERRO POLICE
    else if(level == 3) { PlayerInfo[para1][pChar] = 287; gTeam[para1] = 2; PlayerInfo[para1][pTeam] = 2; } // U.S.Army
    else if(level == 4) { PlayerInfo[para1][pChar] = 275; gTeam[para1] = 4; PlayerInfo[para1][pTeam] = 4; } // Medic
    else if(level == 5) { PlayerInfo[para1][pChar] = 127; } // La Cosa Nostra
    else if(level == 6) { PlayerInfo[para1][pChar] = 120; } // Yakuza
    else if(level == 7) { PlayerInfo[para1][pChar] = 295; } // Mayor
    else if(level == 8) { PlayerInfo[para1][pChar] = 294; } // Hitmans
    else if(level == 9) { PlayerInfo[para1][pChar] = 187; } // SAN News
    else if(level == 10) { PlayerInfo[para1][pChar] = 34; } // M18
    else if(level == 11) { PlayerInfo[para1][pChar] = 171; gTeam[para1] = 11; PlayerInfo[para1][pTeam] = 11; } // Fahrschule
    else if(level == 12) { PlayerInfo[para1][pChar] = 248; } // Hells Angels
    else if(level == 13) { PlayerInfo[para1][pChar] = 270; } // Grove Street
    else if(level == 14) { PlayerInfo[para1][pChar] = 102; } // Ballas
    else if(level == 15) { PlayerInfo[para1][pChar] = 189; } // Red Soldiers
    else if(level == 16) { PlayerInfo[para1][pChar] = 110; } // Los Santos Vagos
    else if(level == 17) { PlayerInfo[para1][pChar] = 115; } // Varios Los Aztecas
    else if(level == 18) { PlayerInfo[para1][pChar] = 294; } // Withe fate
    else if(level == 19) { PlayerInfo[para1][pChar] = 113; } // brigader
    else if(level == 20) { PlayerInfo[para1][pChar] = 220; } // Terroristen
    else if(level == 21) { PlayerInfo[para1][pChar] = 286; gTeam[para1] = 2; PlayerInfo[para1][pTeam] = 2; } //FBI
    else if(level == 22) { PlayerInfo[para1][pChar] = 294; } // Triaden
    else if(level == 23) { PlayerInfo[para1][pChar] = 93; } // Wheelman Agency
    else if(level == 24) { PlayerInfo[para1][pChar] = 71; } // Ordnungsamt
    else if(level == 25) { PlayerInfo[para1][pChar] = 233; } // BikerBoyZ
    else if(level == 26) { PlayerInfo[para1][pChar] = 295; } // VICE News
    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
    }
    }//not connected
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " ** INFO: Das ist ein Adminbefehl, du bist kein Admin!");
    }
    }
    return 1;
    }