Help Me.
#1

Good good do the post because I have a problem with a mysql system houses created by me, well the problem is that it only shows me a house, but to put more homes just I get a to see if you can help me.


Code:


Quote:

#define MAX_CASAS 4
new Text3D:casatext[MAX_CASAS];
new Text3D:casatext2[MAX_CASAS];




enum cInfo
{
Dueno,
Precio,
Float:Entrada_x,
Float:Entrada_y,
Float:Entrada_z,
Float:Salida_x,
Float:Salida_y,
Float:Salida_z,
Nivel,
VirtualWorld,
Interior,
Comprada
}
new CasaInfo[MAX_CASAS][cInfo];




forward CargarCasas();
public CargarCasas()
{
new idx;
while (idx < sizeof(CasaInfo))
{
CasaInfo[idx][Dueno] = cCasas("Dueсo");
CasaInfo[idx][Precio] = cCasas("Precio");
CasaInfo[idx][Entrada_x] = cCasas("Entrada_x");
CasaInfo[idx][Entrada_y] = cCasas("Entrada_y");
CasaInfo[idx][Entrada_z] = cCasas("Entrada_z");
CasaInfo[idx][Salida_x] = cCasas("Salida_x");
CasaInfo[idx][Salida_y] = cCasas("Salida_y");
CasaInfo[idx][Salida_z] = cCasas("Salida_z");
CasaInfo[idx][Nivel] = cCasas("Nivel");
CasaInfo[idx][VirtualWorld] = cCasas("VirtualWorld");
CasaInfo[idx][Interior] = cCasas("Interior");
CasaInfo[idx][Comprada] = cCasas("Comprada");
Texto();
idx++;
}
printf("\t\t[MYSQL]: Cargadas %d casas de la tabla 'casas'\n",idx);

return 1;
}

forward cCasas(campo[]);
public cCasas(campo[])
{
new tmp[128];
new row[60];
format(tmp, 128, "SELECT %s FROM casas", campo);
mysql_query(tmp);
mysql_store_result();
mysql_fetch_row(row);
new resultado;
resultado = strval(row);
mysql_free_result();
return resultado;
}





stock Texto()
{
new idx;
while (idx < sizeof(CasaInfo))
{
switch(CasaInfo[idx][Comprada])
{
case 0:{
format(string, sizeof(string), "{FFFFFF}Precio: {FFFF33}%d{FFFFFF}.\nNivel requerido para su compra: {FFFF33}%d{FFFFFF}.\n{FFFFFF}Usa {FFFF33}/comprar casa {FFFFFF}para comprar o {FFFF33}/entrar {FFFFFF}para una vista previa.", CasaInfo[idx][Precio], CasaInfo[idx][Nivel]);
casatext[idx] = Create3DTextLabel(string,0x3CBAE5FF,CasaInfo[idx][Entrada_x],CasaInfo[idx][Entrada_y],CasaInfo[idx][Entrada_z],40.0,0,1);
idx++;
}case 1:{
format(string, sizeof(string), "{FFFFFF}Propietario: {FFFF33}%s.\n{FFFFFF}Usa {FFFF33}/entrar {FFFFFF}para ingresar.", CasaInfo[idx][Dueno]);
casatext[idx] = Create3DTextLabel(string,0x3CBAE5FF,CasaInfo[idx][Entrada_x],CasaInfo[idx][Entrada_y],CasaInfo[idx][Entrada_z],40.0,0,1);
idx++;
}
}
format(string, sizeof(string), "{FFFFFF}Usa {FFFF33}/salir {FFFFFF}para salir.", CasaInfo[idx][Dueno]);
casatext2[idx] = Create3DTextLabel(string,0x3CBAE5FF,CasaInfo[idx][Salida_x],CasaInfo[idx][Salida_y],CasaInfo[idx][Salida_z],40.0,0,1);
}
return 1;
}

Preview:

.

I is urgent, thanks.

Excuse my English but I'm Spanish.
Reply
#2

I'm not sure I understand the problem...

Is it not loading more than a certain amount of houses..? Or... is it not loading all of the 3D texts?
Reply
#3

Try changing #define MAX_CASAS 4

to: #define MAX_CASAS 400
Reply
#4

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I'm not sure I understand the problem...

Is it not loading more than a certain amount of houses..? Or... is it not loading all of the 3D texts?
my problem is that I only charge a house, put the house I always put out a single.


Quote:
Originally Posted by Memoryz
Посмотреть сообщение
Try changing #define MAX_CASAS 4

to: #define MAX_CASAS 400
Thanks but not working
Reply
#5

Thanks to all but already and fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)