SA-MP Forums Archive
error 033: array must be indexed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 033: array must be indexed (/showthread.php?tid=638920)



error 033: array must be indexed - MRM - 08.08.2017

im getting these errors :

rpg.pwn(746) : error 033: array must be indexed (variable "Type")
rpg.pwn(746) : error 029: invalid expression, assumed zero
rpg.pwn(746) : warning 215: expression has no effect
rpg.pwn(746) : error 001: expected token: ";", but found "]"
rpg.pwn(746) : fatal error 107: too many error messages on one line


PHP код:
enum Req_info
{
    
rpg[3],
    
m4[3]
};
new 
RequestItem[MAX_PLAYERS][Req_info];
CMD:accept(playerid,params[])
{
    new 
ID,Type[16],string[256];
    if(
sscanf(params,"s[16]d",Type,ID))
    {
        
SendClientMessage(playerid,COLOR_ERROR,"Use : /accept type[rpg] playerid");
        return 
1;
    }
    if(
RequestItem[ID][Type][0] != playerid) return SendClientMessage(playerid,COLOR_ERROR,"You have not any request."); //Line 746 



Re: error 033: array must be indexed - Vince - 08.08.2017

You can't use a string as an array index.


Re: error 033: array must be indexed - MRM - 08.08.2017

Quote:
Originally Posted by Vince
Посмотреть сообщение
You can't use a string as an array index.
Thanks