30.04.2013, 18:31
Quote:
La variable "contenido" esta de bonito?
La funciуn "cache_get_field_content" obtiene valores en cadena de carбcteres ("strings") y lo que tu quieres obtener es un nъmero por lo que deberнas obtener el valor con la variable de bonito y luego usar "strval" para entregarle el numйrico a "JugadorInfo[extraid][jRegistrado]". pawn Код:
|
pawn Код:
forward OnQueryFinish(resultid, extraid, ConnectionHandle);
public OnQueryFinish(resultid, extraid, ConnectionHandle)
{
new Filas, Campos, string[256];
if(resultid != THREAD_NO_RESULT)
{
cache_get_data(Filas, Campos);
}
switch(resultid)
{
case THREAD_CHECK_ACCOUNT:
{
if(Filas == 1)
{
new contenido[8];
cache_get_field_content(0, "SQLID", JugadorInfo[extraid][jSQLID]);
cache_get_field_content(0, "Clave", JugadorInfo[extraid][jClave]);
cache_get_field_content(0, "Email", JugadorInfo[extraid][jEmail]);
cache_get_field_content(0, "Registrado", JugadorInfo[extraid][jRegistrado]);
cache_get_field_content(0, "Nivel", JugadorInfo[extraid][jNivel]);
cache_get_field_content(0, "Sexo", JugadorInfo[extraid][jSexo]);
cache_get_field_content(0, "GrupoSanguineo", JugadorInfo[extraid][jGrupoSanguineo]);
cache_get_field_content(0, "Edad", JugadorInfo[extraid][jEdad]);
cache_get_field_content(0, "Pais", JugadorInfo[extraid][jPais]);
cache_get_field_content(0, "DiaNacimiento", JugadorInfo[extraid][jDiaNacimiento]);
cache_get_field_content(0, "MesNacimiento", JugadorInfo[extraid][jMesNacimiento]);
cache_get_field_content(0, "AnoNacimiento", JugadorInfo[extraid][jAnoNacimiento]);
cache_get_field_content(0, "Altura", JugadorInfo[extraid][jAltura]);
cache_get_field_content(0, "Peso", JugadorInfo[extraid][jPeso]);
cache_get_field_content(0, "Raza", JugadorInfo[extraid][jRaza]);
cache_get_field_content(0, "ColorOjos", JugadorInfo[extraid][jColorOjos]);
cache_get_field_content(0, "ColorCabello", JugadorInfo[extraid][jColorCabello]);
cache_get_field_content(0, "EstadoCivil", JugadorInfo[extraid][jEstadoCivil]);
cache_get_field_content(0, "HorasJugadas", JugadorInfo[extraid][jHorasJugadas]);
cache_get_field_content(0, "Interior", JugadorInfo[extraid][jInterior]);
cache_get_field_content(0, "VirtualWorld", JugadorInfo[extraid][jVirtualWorld]);
cache_get_field_content(0, "Skin", JugadorInfo[extraid][jSkin]);
cache_get_field_content(0, "PuntosRol", JugadorInfo[extraid][jPuntosRol]);
cache_get_field_content(0, "Donador", JugadorInfo[extraid][jDonador]);
cache_get_field_content(0, "TiempoDonador", JugadorInfo[extraid][jTiempoDonador]);
cache_get_field_content(0, "Administrador", JugadorInfo[extraid][jAdministrador]);
cache_get_field_content(0, "Lider", JugadorInfo[extraid][jLider]);
cache_get_field_content(0, "Miembro", JugadorInfo[extraid][jMiembro]);
cache_get_field_content(0, "Rango", JugadorInfo[extraid][jRango]);
cache_get_field_content(0, "DivisionLAPD", JugadorInfo[extraid][jDivisionLAPD]);
cache_get_field_content(0, "DivisionLAED", JugadorInfo[extraid][jDivisionLAED]);
cache_get_field_content(0, "Frecuencia", JugadorInfo[extraid][jFrecuencia]);
cache_get_field_content(0, "Trabajo", JugadorInfo[extraid][jTrabajo]);
cache_get_field_content(0, "Trabajo2", JugadorInfo[extraid][jTrabajo2]);
cache_get_field_content(0, "Contrato", JugadorInfo[extraid][jContrato]);
cache_get_field_content(0, "Dinero", JugadorInfo[extraid][jDinero]);
cache_get_field_content(0, "CuentaBancaria", JugadorInfo[extraid][jCuentaBancaria]);
cache_get_field_content(0, "Alcoholemia", JugadorInfo[extraid][jAlcoholemia]);
cache_get_field_content(0, "Drogadiccion", JugadorInfo[extraid][jDrogadiccion]);
cache_get_field_content(0, "EstiloCaminar", JugadorInfo[extraid][jEstiloCaminar]);
cache_get_field_content(0, "EstiloPelea", JugadorInfo[extraid][jEstiloPelea]);
cache_get_field_content(0, "Fuerza", JugadorInfo[extraid][jFuerza]);
cache_get_field_content(0, "HabilidadBoxeo", JugadorInfo[extraid][jHabilidadBoxeo]);
cache_get_field_content(0, "HabilidadKneehead", JugadorInfo[extraid][jHabilidadKneehead]);
cache_get_field_content(0, "HabilidadKungFu", JugadorInfo[extraid][jHabilidadKungFu]);
cache_get_field_content(0, "HabilidadDesert", JugadorInfo[extraid][jHabilidadDesert]);
cache_get_field_content(0, "HabilidadEscNormal", JugadorInfo[extraid][jHabilidadEscNormal]);
cache_get_field_content(0, "HabilidadEscCombate", JugadorInfo[extraid][jHabilidadEscCombate]);
cache_get_field_content(0, "HabilidadMP5", JugadorInfo[extraid][jHabilidadMP5]);
cache_get_field_content(0, "HabilidadAK47", JugadorInfo[extraid][jHabilidadAK47]);
cache_get_field_content(0, "HabilidadM4", JugadorInfo[extraid][jHabilidadM4]);
cache_get_field_content(0, "HabilidadSniper", JugadorInfo[extraid][jHabilidadSniper]);
cache_get_field_content(0, "Muertes", JugadorInfo[extraid][jMuertes]);
cache_get_field_content(0, "Asesinatos", JugadorInfo[extraid][jAsesinatos]);
cache_get_field_content(0, "Arrestos", JugadorInfo[extraid][jArrestos]);
cache_get_field_content(0, "NivelBusqueda", JugadorInfo[extraid][jNivelBusqueda]);
cache_get_field_content(0, "Vida", contenido); JugadorInfo[extraid][jVida] = floatstr(contenido);
cache_get_field_content(0, "Chaleco", contenido); JugadorInfo[extraid][jChaleco] = floatstr(contenido);
cache_get_field_content(0, "CoordX", contenido); JugadorInfo[extraid][jCoordX] = floatstr(contenido);
cache_get_field_content(0, "CoordY", contenido); JugadorInfo[extraid][jCoordY] = floatstr(contenido);
cache_get_field_content(0, "CoordZ", contenido); JugadorInfo[extraid][jCoordZ] = floatstr(contenido);
cache_get_field_content(0, "Experiencia", JugadorInfo[extraid][jExperiencia]);
}
else if(!Filas)
{
//
}
}
case THREAD_CHECK_PASS:
{
if(Filas == 1)
{
cache_get_field_content(0, "Clave", JugadorInfo[extraid][jClave]);
format(string, sizeof(string), "El personaje %s se encuentra registrado en nuestra base de datos.\n\nColoca la contraseсa en el siguiente campo si deseas iniciar sesiуn:", NombreOOC(extraid));
ShowPlayerDialog(extraid, LOGIN, DIALOG_STYLE_PASSWORD,GM_NAME" - Iniciar sesiуn",string,"Enviar","Salir");
}
else if(!Filas)
{
GetPlayerIp(extraid, JugadorInfo[extraid][jIP], 16);
format(string, sizeof(string), "El personaje %s no se encuentra registrado en nuestra base de datos.\n\nColoca una contraseсa si deseas registrarte con este nombre:", NombreOOC(extraid));
ShowPlayerDialog(extraid, REGISTRO, DIALOG_STYLE_PASSWORD,GM_NAME" - Registrar personaje",string,"Enviar","Salir");
}
}
}
return 1;
}