09.02.2013, 23:39
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:
Preview:
.
I is urgent, thanks.
Excuse my English but I'm Spanish.
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; } |
.
I is urgent, thanks.
Excuse my English but I'm Spanish.