CMD:myfriends(playerid, params[])
{
new count = 0;
new iStr[1024] = "Friends Online:~n~";
foreach(Player, i)
{
new USER_FILE[64];
format(USER_FILE, sizeof(USER_FILE), "SFSUsers/%s.ini", GetPlayerNameEx(playerid));
if(DOF2_GetInt(USER_FILE, GetPlayerNameEx(i)) == 1)
{
strins(iStr, GetPlayerNameIns(i), strlen(iStr));
count++;
}
}
if(count == 0)
{
new Str[512];
format(Str,512,"Keiner deiner Freunde ist online.");
ShowPlayerDialog(playerid,FRIENDS,DIALOG_STYLE_MSGBOX,"Freunde",Str,"Ok","");
}
else
{
SetFriendBoxForPlayer(playerid, iStr);
FriendTimer[playerid] = SetTimerEx("HideFriendBoxForPlayer", 6000, false, "i", playerid);
new Str[512];
format(Str,512,"Name: %s Status: {00FF28}Online\n",GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid,FRIENDS,DIALOG_STYLE_LIST,"Freunde",Str,"Ok","");
}
return 1;
}
Ich hab' das jetzt in Dialogen gemacht. Wie schaff ich das, dass alle Freunde in einem Dialog angezeigt werden. Und wie sortiere ich diese nach dem Status: Offline & Online...?
Edit: Rechtschreibung