Little Help
#4

Quote:
Originally Posted by R0
Посмотреть сообщение
Seems like you didnt make it as an iterator, you can make it an iterator or you can just use foreach for all of the players and check their squad id, if it matches do whatever you want there.
I get that, but still same bug, only one name is displeyed, but in squad there are two members.

pawn Код:
CMD:squadronmembers(playerid, params[])
{
    if(pInfo[playerid][pSquadID] == 0) return SendError(playerid, "You are not in a squadron!");
    new LongString[1024], ShortString[180], Count = 0;
   
    foreach(Player, i)
    {
        format(StringSquad,sizeof(StringSquad),"SELECT `UserName` FROM `users` WHERE `SquadID` = %d", pInfo[i][pSquadID]);
        mysql_query(StringSquad);
        mysql_store_result();

        new MemberName[MAX_PLAYER_NAME];
        while(mysql_retrieve_row())
        {
            mysql_get_field("UserName", MemberName);
        }

        Count++;
        format(ShortString, sizeof(ShortString), embed_orange"%s\n", MemberName);
        strcat(LongString,ShortString);

        mysql_free_result();
    }

    if(Count == 0) return Dialog_Show(playerid, SquadDialog, DIALOG_STYLE_MSGBOX, "{BCF562}Squadron Members", embed_red"There is no members", "Ok", "");
    else return Dialog_Show(playerid, SquadDialog, DIALOG_STYLE_MSGBOX ,"{BCF562}Squadron Members", LongString, "Ok", "");
}
Reply


Messages In This Thread
Little Help - by Sanady - 29.08.2015, 12:01
Re: Little Help - by Finn707 - 29.08.2015, 12:24
Re: Little Help - by R0 - 29.08.2015, 12:59
Re: Little Help - by Sanady - 29.08.2015, 17:35
Re: Little Help - by Sanady - 29.08.2015, 18:50
Re: Little Help - by Trollerz - 29.08.2015, 18:51
Re: Little Help - by Sanady - 29.08.2015, 19:01
Re: Little Help - by DRIFT_HUNTER - 29.08.2015, 19:39
Re: Little Help - by R0 - 29.08.2015, 21:59
Re: Little Help - by Nixco - 29.08.2015, 22:14

Forum Jump:


Users browsing this thread: 1 Guest(s)