Hallo Leute,
Die folgende dor-Schleife bricht immer die ganze GamemodeIni Funktion ab, was Kann ich tun?
Code A:
public OnGameModeInit()
{
[...]
HausIni();
AutohausIni();
new debugmsg[32];
format(debugmsg,sizeof(debugmsg),"GameModeIni fertig");
print(debugmsg);
return 1;
}
Code B:
stock HausIni()
{
for(new a=1; mysql_ExistsIt("haussys","Hausnr",CompareSI("",a)));a++)
{
new Float:xout, Float:yout, Float:zout, Float:xin, Float:yin, Float:zin, rent[16], enterp[64], puid;
xout=mysql_GetFloat("haussys", "Xout", "Hausnr", CompareSI("",a));
yout=mysql_GetFloat("haussys", "Yout", "Hausnr", CompareSI("",a));
zout=mysql_GetFloat("haussys", "Zout", "Hausnr", CompareSI("",a));
xin=mysql_GetFloat("haussys", "Xin", "Hausnr", CompareSI("",a));
yin=mysql_GetFloat("haussys", "Yin", "Hausnr", CompareSI("",a));
zin=mysql_GetFloat("haussys", "Zin", "Hausnr", CompareSI("",a));
new outmsg[128];
format(outmsg,sizeof(outmsg),"%i[Haus] X: %f Y: %f Z: %f",z,xout,yout,zout);
print(outmsg);
if(mysql_GetInt("haussys", "Rent", "Hausnr", CompareSI("",a))==0) format(rent, sizeof(rent),"nicht mietbar");
else format(rent, sizeof(rent),"%i",mysql_GetInt("haussys", "Rent", "Hausnr", CompareSI("",a)));
format(enterp,sizeof(enterp),"%s\nBesitzer: %s\nPreis: %i\nMiete: %s",mysql_GetString("haussys","Name","Hausnr",CompareSI("",a)), mysql_GetString("haussys","Owner","Hausnr",CompareSI("",a)), mysql_GetInt("haussys","Price","Hausnr",CompareSI("",a)), rent);
henterlabel[a-1]=Create3DTextLabel(enterp, COLOR_GELB, xout, yout, zout, 5.0,0,1);
if(!strcmp(mysql_GetString("haussys", "Owner", "Hausnr", CompareSI("",a)),"sale",true)) puid=1273;
else puid=1272;
henter[a-1]=CreatePickup(puid,1,xout,yout,zout);
hexit[a-1]=CreatePickup(puid,1,xin,yin,zin);
}
}
Code C:
stock AutohausIni()
{
for(new a=0; mysql_ExistsCar(0,a)!=0;a++)
{
new Float:iX=mysql_GetFloat("ahcfg","X","Hausnr",CompareSI("",a));
new Float:iY=mysql_GetFloat("ahcfg","Y","Hausnr",CompareSI("",a));
new Float:iZ=mysql_GetFloat("ahcfg","Z","Hausnr",CompareSI("",a));
CreatePickup(1210,1,iX,iY,iZ,0);
ahilabel[a]=Create3DTextLabel(mysql_GetString("ahcfg", "Name", "Hausnr", CompareSI("",a)),COLOR_GELB,iX,iY,iZ,20.0,0,0);
for(new b=0;mysql_ExistsCar(b,a)!=0;b++)
{
new myis[8];
format(myis,sizeof(myis),"%i_%i",a,b);
new vid=mysql_GetInt("autohaus", "ID", "car_id", myis);
new Float:vX=mysql_GetFloat("autohaus", "X", "car_id", myis);
new Float:vY=mysql_GetFloat("autohaus", "Y", "car_id", myis);
new Float:vZ=mysql_GetFloat("autohaus", "Z", "car_id", myis);
new Float:vR=mysql_GetFloat("autohaus", "R", "car_id", myis);
new acolor=mysql_GetInt("autohaus", "colora", "car_id", myis);
new bcolor=mysql_GetInt("autohaus", "colorb", "car_id", myis);
new respawnd=mysql_GetInt("autohaus", "respawn", "car_id", myis);
shopcars[a][b][C_Preis]=mysql_GetInt("autohaus", "Price", "car_id", myis);
new texte[32];
format(texte,sizeof(texte),"%s",mysql_GetString("autohaus", "Name", "car_id", myis));
shopcars[a][b][C_Name]=texte;
shopcars[a][b][C_Auto]=CreateVehicle(vid,vX,vY,vZ,vR,acolor,bcolor,respawnd);
SetVehicleParamsEx(shopcars[a][b][C_Auto],0,0,0,0,0,0,0);
new labelstr[64];
format(labelstr,sizeof(labelstr),"Vehicle: %s\nPreis: %i\n/autokaufen",shopcars[a][b][C_Name],shopcars[a][b][C_Preis]);
carlabel[a][b]=Create3DTextLabel(labelstr,COLOR_GELB,vX,vY,vZ,7.5,0,0);
}
}
}
Bei Code A wird debugmsg nicht erreicht.
Danke im Voraus.