27.02.2014, 04:58
Edito: ahora encontre un codigo mal en OnQueryFinish y ahora siempre me dice contraseсa incorrecta ._.
aca el public:
aca el public:
Код:
public OnQueryFinish(resultid, extraid, ConnectionHandle)
{
new Rows, Field, string[256];
if(resultid != 0)
{
cache_get_data(Rows, Field);
}
switch(resultid)
{
case 1:
{
if(Rows == 1)
{
new content[20];
cache_get_field_content(0, "Baneado", content); PlayerInfo[extraid][pBan] = strval(content);
cache_get_field_content(0, "Modelo", content); PlayerInfo[extraid][vModelo] = strval(content);
cache_get_field_content(0, "X", content); PlayerInfo[extraid][vX] = strval(content);
cache_get_field_content(0, "Y", content); PlayerInfo[extraid][vY] = strval(content);
cache_get_field_content(0, "Z", content); PlayerInfo[extraid][vZ] = strval(content);
cache_get_field_content(0, "Color1", content); PlayerInfo[extraid][vColor1] = strval(content);
cache_get_field_content(0, "Color2", content); PlayerInfo[extraid][vColor2] = strval(content);
cache_get_field_content(0, "Admin", content); PlayerInfo[extraid][jAdminNvl] = strval(content);
cache_get_field_content(0, "Score", content); PlayerInfo[extraid][jNivel] = strval(content);
cache_get_field_content(0, "Sexo", content); PlayerInfo[extraid][jSexo] = strval(content);
cache_get_field_content(0, "Money", content); PlayerInfo[extraid][jBancario] = strval(content);
cache_get_field_content(0, "Faccion", content); PlayerInfo[extraid][jMiembro] = strval(content);
cache_get_field_content(0, "Skin", content); PlayerInfo[extraid][jRopa] = strval(content);
cache_get_field_content(0, "Vida", content); PlayerInfo[extraid][jVida] = floatstr(content);
cache_get_field_content(0, "Chaleco", content); PlayerInfo[extraid][jArmadura] = floatstr(content);
cache_get_field_content(0, "posX", content); PlayerInfo[extraid][jPos_x] = floatstr(content);
cache_get_field_content(0, "posY", content); PlayerInfo[extraid][jPos_y] = floatstr(content);
cache_get_field_content(0, "posZ", content); PlayerInfo[extraid][jPos_z] = floatstr(content);
if(PlayerInfo[extraid][pBan] == 1)
{
Kick(extraid);
}
else
autos[extraid] = CreateVehicle(PlayerInfo[extraid][vModelo],PlayerInfo[extraid][vX],PlayerInfo[extraid][vY],PlayerInfo[extraid][vZ],0,PlayerInfo[extraid][vColor1],PlayerInfo[extraid][vColor2],-1);
SetSpawnInfo(extraid,0,PlayerInfo[extraid][jRopa],PlayerInfo[extraid][jPos_x], PlayerInfo[extraid][jPos_y], PlayerInfo[extraid][jPos_z],0,0,0,0,0,0,0);
SetPlayerScore(extraid, PlayerInfo[extraid][jNivel]);
SetPlayerArmour(extraid, PlayerInfo[extraid][jArmadura]);
SetPlayerHealth(extraid, PlayerInfo[extraid][jVida]);
GivePlayerMoney(extraid, PlayerInfo[extraid][jBancario]);
SpawnPlayer(extraid);
}
else if(!Rows)
{
//
}
}
case 2:
{
if(Rows == 1)
{
new pName[24]; GetPlayerName(extraid, pName, 24);
new content[20];
cache_get_field_content(0, "Password", content); PlayerInfo[extraid][pPassword] = strval(content);
format(string, sizeof(string), "El personaje %s estб registrado en la base de datos. Pon los datos para iniciar sesiуn:", pName);
ShowPlayerDialog(extraid, LOGIN, DIALOG_STYLE_PASSWORD,"Login",string,"Enviar","Salir");
}
else if(!Rows)
{
new pName[24]; GetPlayerName(extraid, pName, 24);
format(string, sizeof(string), "El jugador %s no estб registrado en el servidor, pon aquн la contraseсa para registrarlo:", pName);
ShowPlayerDialog(extraid, REGISTRO, DIALOG_STYLE_PASSWORD,"Registro:",string,"Enviar","Salir");
}
}
}
return 1;
}

