29.06.2016, 16:00
Buenas, cree casas dinбmicas y bien, pero cuando cargan al abrir al gamemode y entro se cierra la consola cuando estб el cargado, pero si lo desactivo si me anda bien el gamemode їA quй se debe? acб dejo el cargado completo, las casas son case 4:
Si se puso el cуdigo desorganizado es por el foro, yo no programo asн.
Код:
CALLBACK: OnQueryFinish_(resultid, extraid, ConnectionHandle)
{
new
Rows, Field;
if(resultid != 0)
{
cache_get_data(Rows, Field);
}
switch(resultid)
{
case 1:
{
new
content[20];
if(Rows == 1)
{
cache_get_field_content(0, "SQLID", content); PlayerInfo[extraid][pSQLID] = strval(content);
cache_get_field_content(0, "Edad", content); PlayerInfo[extraid][pEdad] = strval(content);
cache_get_field_content(0, "Dinero", content); PlayerInfo[extraid][pDinero] = strval(content);
cache_get_field_content(0, "Registrado", content); PlayerInfo[extraid][pRegistrado] = strval(content);
cache_get_field_content(0, "Skin", content); PlayerInfo[extraid][pSkin] = strval(content);
cache_get_field_content(0, "Negocio", content); PlayerInfo[extraid][pNegocio] = strval(content);
cache_get_field_content(0, "Casa", content); PlayerInfo[extraid][pCasa] = strval(content);
cache_get_field_content(0, "Sexo", content); PlayerInfo[extraid][pSexo] = strval(content);
cache_get_field_content(0, "Nivel", content); PlayerInfo[extraid][pNivel] = strval(content);
cache_get_field_content(0, "Vida", content); PlayerInfo[extraid][pVida] = floatstr(content);
cache_get_field_content(0, "Chaleco", content); PlayerInfo[extraid][pChaleco] = floatstr(content);
cache_get_field_content(0, "PosX", content); PlayerInfo[extraid][pPosX] = floatstr(content);
cache_get_field_content(0, "PosY", content); PlayerInfo[extraid][pPosY] = floatstr(content);
cache_get_field_content(0, "PosZ", content); PlayerInfo[extraid][pPosZ] = floatstr(content);
SetSpawnInfo(extraid, 0, PlayerInfo[extraid][pSkin], PlayerInfo[extraid][pPosX], PlayerInfo[extraid][pPosY], PlayerInfo[extraid][pPosZ], 1.0, -1, -1, -1, -1, -1, -1);
SetPlayerScore(extraid, PlayerInfo[extraid][pNivel]), SetPlayerArmour(extraid, PlayerInfo[extraid][pChaleco]), SetPlayerInterior(extraid, PlayerInfo[extraid][pInterior]);
SetPlayerHealth(extraid, PlayerInfo[extraid][pVida]), GivePlayerMoney(extraid, PlayerInfo[extraid][pDinero]), SetPlayerVirtualWorld(extraid, PlayerInfo[extraid][pVirtualWorld]);
SpawnPlayer(extraid), SpawnJugador[extraid] = 1;
}
else if(!Rows)
{
}
}
case 2:
{
if(Rows)
{
cache_get_field_content(0, "Contraseсa", PlayerInfo[extraid][pPassword]);
new
string[186];
format(string, 186, ""#CBLANCO"Bienvenido(a) "#CVERDE"%s.\n\n"#CBLANCO"Tu cuenta estб registrada en nuestra base de datos, Ingrese su contraseсa:", NombreJugador(extraid));
ShowPlayerDialog(extraid, DIALOG_INGRESO, DIALOG_STYLE_PASSWORD, ""#CAZUL"Login", string, "Ingresar","Cancelar");
PlayAudioStreamForPlayer(extraid, "https://dl.dropboxusercontent.com/s/ogdhx4lf6f1b9j7/IntroSpanishRol.mp3"), LimpiarConsola(extraid, 30);
}
else if(!Rows)
{
new
string[186];
format(string, 186, ""#CBLANCO"Bienvenido(a) "#CVERDE"%s.\n\n"#CBLANCO"Tu cuenta no esta registrada en nuestra base de datos, Ingresa una contraseсa:", NombreJugador(extraid));
ShowPlayerDialog(extraid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, ""CAZUL"Registro", string, "Registrar","Cancelar");
LimpiarConsola(extraid, 30);
}
}
case 3:
{
cache_get_data(Rows, Field, TuberiaMYSQL);
if(Rows)
{
for(new i; i < Rows; i++)
{
new
content[20], Query[80];
format(Query, sizeof(Query), "SELECT nSQLID FROM ev_negocios ORDER BY nSQLID DESC");
mysql_function_query(TuberiaMYSQL, Query, true, "OnQueryFinish_", "i", 0);
cache_get_field_content(i, "nSQLID", content); NegocioInfo[i][nSQLID] = strval(content);
cache_get_field_content(i, "nNombre", NegocioInfo[i][nNombre]);
cache_get_field_content(i, "nPosX", content); NegocioInfo[i][nPosX] = floatstr(content);
cache_get_field_content(i, "nPosY", content); NegocioInfo[i][nPosY] = floatstr(content);
cache_get_field_content(i, "nPosZ", content); NegocioInfo[i][nPosZ] = floatstr(content);
cache_get_field_content(i, "nIntX", content); NegocioInfo[i][nIntX] = floatstr(content);
cache_get_field_content(i, "nIntY", content); NegocioInfo[i][nIntY] = floatstr(content);
cache_get_field_content(i, "nIntZ", content); NegocioInfo[i][nIntZ] = floatstr(content);
cache_get_field_content(i, "nInterior", content); NegocioInfo[i][nInterior] = strval(content);
cache_get_field_content(i, "nIntExt", content); NegocioInfo[i][nIntExt] = strval(content);
cache_get_field_content(i, "nVirtualWorld", content); NegocioInfo[i][nVirtualWorld] = strval(content);
cache_get_field_content(i, "nEstado", content); NegocioInfo[i][nEstado] = strval(content);
cache_get_field_content(i, "nPropietario", NegocioInfo[i][nPropietario]);
cache_get_field_content(i, "nPrecio", content); NegocioInfo[i][nPrecio] = strval(content);
cache_get_field_content(i, "nPrecioEntrada", content); NegocioInfo[i][nPrecioEntrada] = strval(content);
cache_get_field_content(i, "nPuerta", content); NegocioInfo[i][nPuerta] = strval(content);
cache_get_field_content(i, "nCambios", content); NegocioInfo[i][nCambios] = strval(content);
cache_get_field_content(i, "nDinero", content); NegocioInfo[i][nDinero] = strval(content);
cache_get_field_content(i, "nNivel", content); NegocioInfo[i][nNivel] = strval(content);
NegocioInfo[i][nPickup] = CreatePickup(1272, 1, NegocioInfo[i][nPosX], NegocioInfo[i][nPosY], NegocioInfo[i][nPosZ]);
NegocioInfo[i][nTexto] = CreateDynamic3DTextLabel("", COLOR_BLANCO, NegocioInfo[i][nPosX], NegocioInfo[i][nPosY], NegocioInfo[i][nPosZ], 5.0);
ActualizarTextoNegocio(i), TotalNegocios = Rows;
}
printf("*- Se han cargado un total de %d negocios.", Rows);
}
else if(!Rows)
{
print("*- No se ha cargado ningъn negocio.");
}
}
case 4:
{
cache_get_data(Rows, Field, TuberiaMYSQL);
if(Rows)
{
for(new i; i < Rows; i++)
{
new
content[20], Query[80];
format(Query, sizeof(Query), "SELECT cSQLID FROM ev_casas ORDER BY cSQLID DESC");
mysql_function_query(TuberiaMYSQL, Query, true, "OnQueryFinish", "i", 0);
cache_get_field_content(i, "cSQLID", content);CasaInfo[i][cSQLID] = strval(content);
cache_get_field_content(i, "cPosX", content);CasaInfo[i][cPosX] = floatstr(content);
cache_get_field_content(i, "cPosY", content);CasaInfo[i][cPosY] = floatstr(content);
cache_get_field_content(i, "cPosZ", content);CasaInfo[i][cPosZ] = floatstr(content);
cache_get_field_content(i, "cIntX", content);CasaInfo[i][cIntX] = floatstr(content);
cache_get_field_content(i, "cIntY", content);CasaInfo[i][cIntY] = floatstr(content);
cache_get_field_content(i, "cIntZ", content);CasaInfo[i][cIntZ] = floatstr(content);
cache_get_field_content(i, "Precio", content);CasaInfo[i][cPrecio] = strval(content);
cache_get_field_content(i, "cInterior", content);CasaInfo[i][cInterior] = strval(content);
cache_get_field_content(i, "cVirtualWorld", content);CasaInfo[i][cVirtualWorld] = strval(content);
cache_get_field_content(i, "cPuerta", content);CasaInfo[i][cPuerta] = strval(content);
cache_get_field_content(i, "cPropietario", CasaInfo[i][cPropietario]);
cache_get_field_content(i, "cDescripcion", CasaInfo[i][cDescripcion]);
cache_get_field_content(i, "cEstado", content);CasaInfo[i][cEstado] = strval(content);
cache_get_field_content(i, "cMirX", content);CasaInfo[i][cMirX] = floatstr(content);
cache_get_field_content(i, "cMirY", content);CasaInfo[i][cMirY] = floatstr(content);
cache_get_field_content(i, "cMirZ", content);CasaInfo[i][cMirZ] = floatstr(content);
cache_get_field_content(i, "cMirA", content);CasaInfo[i][cMirA] = floatstr(content);
if(CasaInfo[i][cEstado] == 0)
{
CasaInfo[i][cPickup] = CreateDynamicPickup(1273, 1, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]);
}
else if(CasaInfo[i][cEstado] == 1)
{
CasaInfo[i][cPickup] = CreateDynamicPickup(19522, 1, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]);
}
TotalCasas = Rows;
}
printf("*- Se han cargado un total de %d propiedades.", Rows);
}
else if(!Rows)
{
print("*- No se ha cargado ninguna propiedad.");
}
}
}
return 1;
}


