Hallo Liebe Community ich habe eine leader liste erstellt
aber irgendwie zeigt der manchmal leader nebeneinander im dialog
ein dann untereinander er soll jeden leader untereinander anzeigen
was ist falsch?
#include <sscanf2>
if(strcmp("/leaderlist", cmd, true) == 0)
{
new data[64],fName,sName[MAX_PLAYER_NAME],ShowList[1200];
mysql_query("SELECT `Name`, `Leader` FROM `users` WHERE `Leader` > 0");
mysql_store_result();
while(mysql_fetch_row_format(data)){
sscanf(data,"p<|>s[20]d",sName,fName);
format(data,64,"{FFFFFF}%s Leader: %s (%s{FFFFFF})\n",GetFraktion(fName),sName,((!OnlineByName(sName))?("{F6000F}Offline"):("{00EE14}Online")));
strcat(ShowList,data);
}
mysql_free_result();
ShowPlayerDialog(playerid,DIALOG_VOGELLEADER,DIALOG_STYLE_MSGBOX,"Leaders",ShowList,"Bestätigen","");
return 1;
}
stock GetFraktion(frak){
new fName[20]="Unbekannt";
switch(frak){
case 1: fName="N.S.A";
case 2: fName="Parkhouse Drifer";
case 3: fName="Feuerwehr";
case 4: fName="Medic";
case 5: fName="La Cosa Nostra";
case 6: fName="Yakuza";
case 7: fName="F.B.I";
case 8: fName="Hitman";
case 9: fName="News Reporter";
case 10: fName="Wheelman";
case 11: fName="Fahrschule";
case 12: fName="Regierung";
case 13: fName="Ordnungsamt";
case 14: fName="SAPD";
case 15: fName="Hells Angels";
case 16: fName="Nichts";
case 17: fName="Russen Mafia";
case 18: fName="Aztecas";
case 19: fName="Grove Street";
case 20: fName="Ballas";
case 21: fName="WCC";
case 22: fName="Triaden";
case 23: fName="Red Soliders";
case 24: fName="L.S Vagos";
case 25: fName="Guerilla";
case 26: fName="Cali Kartell";
}
return fName;
}
stock OnlineByName(string[]){
new i;
for(; i < MAX_PLAYERS ; ++i)if(IsPlayerConnected(i) && !strcmp(string,PlayerInfo[i][pLeaderListe],false))return 1;
return 0;
}
ONPLAYERCONNECT:
GetPlayerName(playerid,PlayerInfo[playerid][pLeaderListe],MAX_PLAYER_NAME);
Kann mir jemand das problem beheben?
so siehts aus ingame: