Nearest players list
#1

So, I don't know how to check which player did I chosen on the list, cause list is working fine, but OnDialogResponse fails.

CMD:
pawn Код:
YCMD:nearby(playerid, params[], help)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);

    new string[128],
        count = 0;

    ForeachEx(i, MAX_PLAYERS)
    {
        if(!IsPlayerConnected(i) || i == playerid)continue;

        if(IsPlayerInRangeOfPoint(i, 5.0, X, Y, Z))
        {
            format(string, sizeof(string), "%s(%d)\t%s\n", string, i, PlayerName(i));
            count += 1;
        }
    }

    if(count != 0)
    {
        ShowPlayerDialog(playerid, 32767, DIALOG_STYLE_LIST, "Najbliżsi gracze", string, "Wybierz", "");
    }
    else SendClientMessage(playerid, -1, "Brak graczy w pobliżu!");
    return true;
}
OnDialogResponse
pawn Код:
case 32767:
        {
            if(!response)return false;
            else
            {
                new string[128];
                format(string, sizeof(string), "%s (%d) wybrał właśnie Ciebie!", PlayerName(playerid), playerid);
                SendClientMessage(listitem, -1, string);

                format(string, sizeof(string), "Wybrałeś %s (%d)!", PlayerName(listitem), listitem);
                SendClientMessage(playerid, -1, string);
            }
        }
Reply


Messages In This Thread
Nearest players list - by Riddick94 - 10.04.2013, 16:23
Re: Nearest players list - by fordawinzz - 10.04.2013, 16:28
AW: Nearest players list - by Nero_3D - 10.04.2013, 16:38
Re: Nearest players list - by Riddick94 - 10.04.2013, 16:39
Re: AW: Nearest players list - by Riddick94 - 10.04.2013, 17:00
AW: Nearest players list - by Nero_3D - 10.04.2013, 19:16
Re: Nearest players list - by Riddick94 - 10.04.2013, 19:27

Forum Jump:


Users browsing this thread: 1 Guest(s)