Beiträge von Vincenty

    Hier ist etwas nicht in Ordnung.



    stock GetFraktion(playerid){
    new fName[20]="Unbekannt";
    switch(PlayerInfo[playerid][pLeader]){
    case 1: fName="LSPD";
    case 2: fName="SFPD";
    case 3: fName="Armee";
    case 4: fName="Rettungsdienst";
    case 5: fName="La Cosa Nostra";
    case 6: fName="Yakuza";
    case 7: fName="Regierungs";
    case 8: fName="Hitman";
    case 9: fName="News Reporter";
    case 10: fName="Taxi Company";
    case 11: fName="Fahrschul";
    case 12: fName="Groove Street";
    case 13: fName="Ballas";
    case 14: fName="Hells Angels";
    case 15: fName="Aztecas";
    case 16: fName="LVPD";
    case 17: fName="Terroristen";
    case 18: fName="ADAC";
    }
    return fname;


    }


    Es steht dort immer "unbekannter Leader"

    Hallo,


    Ich würde gerne alle Fraktionsleader auch die die Offline sind aus einer Mysql Datenbank auslesen und anschließend in einem Dialog ausgeben.


    Hat jemand eine Idee wie das Funktioniert ?



    //Edit


    hier mal mein versuch



    ocmd:leaders(playerid,params[])
    {
    new string[500],name[100], vz[100],FraktionsText[20];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pLeader] == 1)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"LSPD Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 2)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"SFPD Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 3)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Armee Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 4)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Rettungsdienst Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 5)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"La Cosa Nostra Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 6)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Yakuza Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 7)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Regierungs Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 8)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Hitman Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 9)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"News Reporter Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 10)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Taxi Company Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 11)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Fahrschul Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 12)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Groove Street Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 13)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Ballas Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 14)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Hells Angels Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 15)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Aztecas Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 16)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"LVPD Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 17)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"Terroristen Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    if(PlayerInfo[i][pLeader] == 18)
    {
    GetPlayerName(i, name, 24);
    format(vz, 32,"ADAC Leader: (%d)%s\n",i,name);
    strcat(string, vz);
    }
    ShowPlayerDialog(playerid,325,DIALOG_STYLE_LIST,"Leaders",string,"Bestätigen","");
    }
    }
    }


    Grüße
    Vincenty