Hallo,
ich schreibe derzeit ein Tanksystem und habe schon Anfängerschwierigkeiten.
Und zwar bekomme ich Fehlermeldungen:
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(17014) : warning 213: tag mismatch
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18455) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18458) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18458) : warning 213: tag mismatch
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18461) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18461) : warning 213: tag mismatch
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18464) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18464) : warning 213: tag mismatch
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18467) : warning 213: tag mismatch
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18470) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18473) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18476) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18479) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18482) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18496) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18497) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18501) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18501) : warning 215: expression has no effect
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18501) : warning 215: expression has no effect
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18501) : error 032: array index out of bounds (variable "TankInfo")
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18501) : error 029: invalid expression, assumed zero
C:\Users\Patrick\Desktop\SV 0.3z\gamemodes\nglrole.pwn(18501) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
15 Errors.
also scheint es Probleme mit der enum von der Variable TankInfo zu geben was ich aber leider nicht verstehen kann und daher um Hilfe von euch bitte.
Enum:
[pwn=3704]
enum TInfo
{
owner[64],
beschreibung[128],
posX,
posY,
posZ,
buyprice,
level,
exp,
kasse,
products,
maxproducts,
created = false,
fillprice,
label,
pickup
};
new TankInfo[50][TInfo];
[/pwn]
Und LoadTanken (Wo die Fehler herkommen
[pwn=18444]
public LoadTanken()
{
new val[128],query[256], Text[200];
for(new idx; idx<sizeof(TankInfo); idx++)
{
format(query, sizeof(query), "SELECT * FROM `tanken` WHERE `id` = %d", idx);
mysql_query(query);
mysql_store_result();
if(mysql_retrieve_row())
{
mysql_fetch_field_row(TankInfo[idx][owner],"owner");
mysql_fetch_field_row(TankInfo[idx][beschreibung],"beschreibung");
mysql_fetch_field_row(val,"posX");
TankInfo[idx][posX] = floatstr(val);
mysql_fetch_field_row(val,"posY");
TankInfo[idx][posY] = floatstr(val);
mysql_fetch_field_row(val,"posZ");
TankInfo[idx][posZ] = floatstr(val);
mysql_fetch_field_row(val,"buyprice");
BizzInfo[idx][buyprice] = strval(val);
mysql_fetch_field_row(val,"level");
TankInfo[idx][level] = strval(val);
mysql_fetch_field_row(val,"exp");
TankInfo[idx][exp] = strval(val);
mysql_fetch_field_row(val,"kasse");
TankInfo[idx][kasse] = strval(val);
mysql_fetch_field_row(val,"products");
TankInfo[idx][products] = strval(val);
mysql_fetch_field_row(val,"maxproducts");
TankInfo[idx][maxproducts] = strval(val);
mysql_fetch_field_row(val,"fillprice");
TankInfo[idx][fillprice] = strval(val);
TankInfo[idx][created] = true;
}
mysql_free_result();
if(TankInfo[idx][created])
{
if(TankInfo[idx][owner] == 0)
{
format(Text,sizeof(Text),"{F5FF00]=== {B400FF}%s {F5FF00}===\nPreis: %d$\nLevel: %d\n\n{B400FF}Benutze: /Buytanke um die Tankstelle zu kaufen.", TankInfo[idx][beschreibung], TankInfo[idx][level], TankInfo[idx][buyprice]);
TankInfo[idx][pickup] = CreatePickup(1274,1,TankInfo[idx][posX],TankInfo[idx][posY],TankInfo[idx][posZ],-1);
}
else
{
format(Text,sizeof(Text),"{F5FF00]=== {B400FF}%s {F5FF00}===\nEigentümer: %s\nPreis pro Liter: %d$\nLevel: %d", TankInfo[idx][beschreibung] TankInfo[idx][owner], TankInfo[idx][fillprice], TankInfo[idx][level]);
TankInfo[idx][pickup] = CreatePickup(1650,1,TankInfo[idx][posX],TankInfo[idx][posY],TankInfo[idx][posZ],-1);
}
TankInfo[idx][label] = Create3DTextLabel(Text,0xFFFFFFFF,TankInfo[idx][posX],TankInfo[idx][posY],TankInfo[idx][posZ],30.0,0,true);
}
}
}
[/pwn]
Kann mir einer helfen?
Liebe Grüße
palwal
Edit: Zeilennummern hinzugefügt