some errors.. - 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: some errors.. (
/showthread.php?tid=492819)
some errors.. -
radiobizza - 05.02.2014
gold-rpg.pwn(757) : error 028: invalid subscript (not an array or too many subscripts): "Fuell"
gold-rpg.pwn(757) : error 001: expected token: ";", but found "]"
gold-rpg.pwn(757) : error 029: invalid expression, assumed zero
The line:
PHP код:
[COLOR="Red"]if(Fuell[GetPlayerVehicleID(playerid)] <= 30)[/COLOR]
{
vehs = "~r~";
}
Re: some errors.. -
Borg - 05.02.2014
Can you show us your Fuell declaration, like "new Fuell..."?
Re: some errors.. -
radiobizza - 05.02.2014
PHP код:
public UpdateSpeedometr(playerid)
{
if(GetPlayerState(playerid) == 2)
{
new locked[32];
new str[64],str2[64],str3[64];
new str4[64];
new str5[64], str6[64];
new Float:vehhel, vehh[20], vehs[20], vehe[20], veher[20];
if(IsLocked[GetPlayerVehicleID(playerid)] == true) locked = "~r~LOCK";
else locked = "~g~UNLOCK";
GetVehicleHealth(GetPlayerVehicleID(playerid), vehhel);
if(vehhel <= 500) vehh = "~r~";
else vehh = " ";
if(Fuell[GetPlayerVehicleID(playerid)] <= 30)
{
vehs = "~r~";
}
else vehs = "";
if(zavodis[playerid] == true) vehe = "~g~ON";
else vehe = "~r~OFF";
format(str, sizeof(str),"%d KM/H",SpeedVehicle(playerid) / 2);
if(vehhel <= 300) format(str3, sizeof(str3),"%s30%",vehh); else format(str3, sizeof(str3),"%s%.0f%",vehh,vehhel / 10);
format(str2, sizeof(str2), "%s", locked);
format(str4, sizeof(str4), "%s%.0f", vehs,Fuell[GetPlayerVehicleID(playerid)]);
format(str5, sizeof(str5), "%s", vehe);
format(str6, sizeof(str6), "%s", veher);
TextDrawSetString(FuelShow[playerid],str4);
TextDrawSetString(HealthShow[playerid],str3);
TextDrawSetString(SpeedShow[playerid],str);
TextDrawSetString(StatusShow[playerid],str2);
TextDrawSetString(Speed2Show[playerid],str6);
TextDrawSetString(EngineShow[playerid],str5);
UnSurfCar(GetPlayerVehicleID(playerid));
}
return 0;
}
Re: some errors.. -
Sawalha - 05.02.2014
You could do like this , simple:
pawn Код:
new veh = GetPlayerVehicleID(playerid);
if(Fuell(veh) <=30)
and correct definition for Fuell variable is new Fuell[MAX_VEHICLES];
isn't it?
Re: some errors.. -
radiobizza - 05.02.2014
yeah..thx