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