CMD error
#2

Quote:
Originally Posted by SukMathcuck
Посмотреть сообщение
I did this command but it does not work, what should I do to show the dialog? Or rather what I did wrong?

PHP код:
CMD:flist(playeridparams[])
{
    new 
dialogo[200], string[200];
    for (new 
0!= MAX_FACTIONS++) if (FactionData[i][factionExists])
    {
        
format(dialogo128"{FFFFFF}[%d] {%06x}%s"iFactionData[i][factionColor] >>> 8FactionData[i][factionName]);
        
strcat(stringdialogo);
    }
    
ShowPlayerDialog(playerid0DIALOG_STYLE_LIST"Lista de facзхes"string"Fechar""");
    return 
1;

well, most likely accesing something out of bounds of "FactionData" and
because of that the processing of the cmd stops exactly when that happens
and you'll get the "unknown command" message

the end condition in your for-loop is incorrect.

it should be
i < MAX_FACTIONS
and not
i != MAX_FACTIONS

for example, lets say

#define DDD (20)

and you do something like

new abc[DDD];

elements range from 0 to DDD-1

if you do

i < DDD

it would stop right before 20
and that's good since
abc[20]
would be out of abc's boundaries
Reply


Messages In This Thread
CMD error - by SukMathcuck - 04.01.2017, 18:35
Re: CMD error - by CutX - 04.01.2017, 18:41
Re: CMD error - by Yaa - 04.01.2017, 18:44
Re: CMD error - by SukMathcuck - 04.01.2017, 19:35

Forum Jump:


Users browsing this thread: 1 Guest(s)