error 033 need help on this - 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 need help on this (
/showthread.php?tid=541682)
error 033 need help on this -
weedxd - 13.10.2014
Haven't met this error before so im askin for your help.
Define:
PHP код:
new fMeter[MAX_PLAYERS];
PHP код:
error 033: array must be indexed (variable "fMeter")
PHP код:
// Fuel
if(fMeter[playerid] && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
/*This Line*/ if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 509 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 481 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 510 || fMeter > false)
{
new string[64];
format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Fuel: ~w~%d%", Fuel[GetPlayerVehicleID(playerid)]);
GameTextForPlayer(playerid, string,1000, 3);
}
}
Re: error 033 need help on this -
AdHaM612 - 13.10.2014
pawn Код:
// Fuel
if(fMeter[playerid] && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 509 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 481 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 510 || fMeter > false) // You forgot to assign the array in this line.
{
new string[64];
format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Fuel: ~w~%d%", Fuel[GetPlayerVehicleID(playerid)]);
GameTextForPlayer(playerid, string,1000, 3);
}
}
I think you forgot to assign the array at "fMeter > false" , so it should be: "fMeter[playerid] > false".
Re: error 033 need help on this -
weedxd - 13.10.2014
With
PHP код:
fMeter[playerid] > false)
I get this
PHP код:
24740) : warning 213: tag mismatch
Tried
PHP код:
fMeter(playerid) > false)
Got this
PHP код:
: error 012: invalid function call, not a valid address
: warning 215: expression has no effect
: error 001: expected token: ";", but found ")"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
EDIT: problem was
fMeter[playerid] > false)
fixed it
fMeter[playerid] > 0)
Thanks for the help
+ Rep
Re: error 033 need help on this -
Chenko - 13.10.2014
fMeter is not a boolean so you can't compare it to true and false. Instead of "fMeter[playerid] > false" do "fMeter[playerid] > 0"