pasted-from-clipboard.png
Hab da irgendwas falsch gemacht 
Er zeigt überall mein Namen an sowie das alle Offline sind obwohl ich ja Online bin sowie ein weiterer Leader.
ocmd:leaderlist(playerid)
{
new data[128],fName,igName[MAX_PLAYER_NAME],showList[1200];
mysql_query("SELECT `Name`, `Leader` FROM `accounts` WHERE `Leader` > 0");
mysql_store_result();
while(mysql_fetch_row_format(data)){
strins(data, "|", strlen(data));
printf("data: %s", data);
new oldi=0, count=0;
for(new i=0; i<strlen(data); i++)
{
if(data[i]=='|')
{
count++;
new tmpstring[sizeof(data)]; tmpstring=data;
strdel(tmpstring, i, strlen(tmpstring));
strdel(tmpstring, 0, oldi+1);
switch(count)
{
case 1: format(igName, sizeof(igName), "%s", tmpstring);
case 2: fName = strval(tmpstring);
}
oldi=i;
}
}
printf("sName: %s | fName: %d | return: %s", igName, fName, GetFraktion(fName));
format(showList,sizeof(showList),"%s{FFFFFF}%s Leader: %s (%s{FFFFFF})\n",showList,GetFraktion(fName),SpielerInfo[playerid][sName],((!OnlineByName(igName))?("{F6000F}Offline"):("{00EE14}Online")));
}
mysql_free_result();
ShowPlayerDialog(playerid,DIALOG_LEADERS,DIALOG_STYLE_MSGBOX,"Leaders",showList,"Bestätigen","");
return 1;
}
stock GetFraktion(frak)
{
new fName[37]="Unbekannt";
switch(frak)
{
case 1:{fName="San Andreas Government Department";}
case 2:{fName="San Andreas Police Department";}
case 3:{fName="Central Defensive Marshallas Service";}
case 4:{fName="San Andreas Feuerwehr";}
case 5:{fName="San Andreas Rettungsdienst";}
case 6:{fName="Federal Bureau of Investigation";}
case 7:{fName="San Andreas Ordnungsamt";}
case 8:{fName="Interglobal Television";}
case 9:{fName="Grove Street Families";}
case 10:{fName="Rolling High Ballas";}
case 11:{fName="Los Santos Vagos";}
case 12:{fName="Los Aztecas";}
case 13:{fName="San Fierro Rifa";}
case 14:{fName="Triaden";}
case 15:{fName="Yakuza";}
case 16:{fName="Camorra";}
case 17:{fName="Italian Mafia";}
case 18:{fName="Russian Mafia";}
case 19:{fName="International Contract Agency";}
}
return fName;
}
stock OnlineByName(string[])
{
for(new i; i < MAX_PLAYERS ; ++i) if(IsPlayerConnected(i) && !strcmp(string,f_pName(i),false)) return 1;
return 0;
}
stock f_pName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
Alles anzeigen