DCMD - Unknown command?
#2

Run time error: Array index out of bounds because ClassName has size of 5 and the valid indexes are 0-4 but you used "<=" instead of "<" in the loop. Also ShowPlayerDialog should be outside of the loop otherwise you call it many times for no reason.

pawn Код:
dcmd_class(playerid, params[])
{
    #pragma unused params
   
    new
        eqpt[128];
   
    for (new i; i != sizeof (ClassName); ++i)
    {
        strcat(eqpt, ClassName[i][playerid]);
        strcat(eqpt, "\n");
    }
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Class selection", eqpt, "Select", "");
    return 1;
}
Reply


Messages In This Thread
DCMD - Unknown command? - by SA_martin_SK - 05.02.2014, 16:55
Re: DCMD - Unknown command? - by Konstantinos - 05.02.2014, 18:59
Re: DCMD - Unknown command? - by SA_martin_SK - 05.02.2014, 19:19

Forum Jump:


Users browsing this thread: 1 Guest(s)