array must be indexed (variable "result")
#1

pawn Код:
dcmd_mevent(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
    {
         new sendername[MAX_PLAYER_NAME],string[86];
         GetPlayerName(playerid,sendername,sizeof(sendername));
        new text[128],cash,result[10];
        if(sscanf(params,"isi",cash,text,result))return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /mevent [Prize Money] [The Test] [The Result]");
        if(cash < 1 || cash > 1000000000) return SendClientMessage(playerid,COLOR_WHITE,"ERROR: Invalid prize money. Please use $1 - $1000000000.");
        if(strlen(text) > 20) return SendClientMessage(playerid,COLOR_WHITE,"ERROR: Your question is to long. Please shorten it to 20 characters max.");
        if(result < 1 || result > 10) return SendClientMessage(playerid,COLOR_WHITE,"ERROR: Your result is to long. Please shorten it to 10 characters max."); // line 11631
        SendClientMessage(playerid,COLOR_LIGHTRED,"You have forced a custom math event.");
        format(string,sizeof(string),"Admin %s has started the math event.",sendername);
         SendClientMessageToAll(0x55946AAA,string);
         format(MateString,sizeof(MateString),"%s",text);
        MateCash = cash;
        MateResult = result; // line 11637
        mateTest();
    }
    return 1;
}
Код:
D:\---\---\---.pwn(11631) : error 033: array must be indexed (variable "result")
D:\---\---\---.pwn(11637) : error 006: must be assigned to an array
How can I solve it?
For example:
/mevent 1000 5-2 3
Reply
#2

take the [10] away from result[10];
Reply
#3

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)