23.04.2012, 15:02
I'm getting the following error message on each if(tgate line:
error 033: array must be indexed (variable "-unknown-")
The command and what I'm trying to do is pretty self explanatory. This is the first time I haven't been able to debug something by myself so any help is greatly appreciated. I've tried using format() too with no luck.
error 033: array must be indexed (variable "-unknown-")
The command and what I'm trying to do is pretty self explanatory. This is the first time I haven't been able to debug something by myself so any help is greatly appreciated. I've tried using format() too with no luck.
Код:
CMD:agate(playerid, params[]) { new tgate; if(PlayerIsL3A(playerid) == 1) { if(sscanf(params, "s[1]", tgate)) return SendClientMessage(playerid, -1, "USAGE: /agate [gate]"); if(tgate == "a") { if(GateO[0] == false) { MoveObject(Gate[0], 120.81, 1942.33, 21.63, 2.00); GateO[0] = true; } else if (GateO[0] == true) { MoveObject(Gate[0], 134.67, 1942.33, 21.63, 2.00); GateO[0] = false; } } else if (tgate == "b") { if(GateO[1] == false) { MoveObject(Gate[1], 96.93, 1925.09, 18.22, 2.00); GateO[1] = true; } else if (GateO[1] == true) { MoveObject(Gate[1], 96.93, 1922.42, 18.22, 2.00); GateO[1] = false; } } else if (tgate == "c") { if(GateO[2] == false) { MoveObject(Gate[2], 286.00, 1834.60, 19.99, 2.00); GateO[2] = true; } else if (GateO[2] == true) { MoveObject(Gate[2], 286.00, 1821.38, 19.99, 2.00); GateO[2] = false; } } else { SendClientMessage(playerid, COLOR_YELLOW, "[ ! ] The gate ID you provided was invalid."); } } return 1; }