08.12.2014, 23:22
you had syntax error, this should do
pawn Код:
{
new string[256];
new pName[24], Query[256]; GetPlayerName(playerid, pName, 24);
switch(dialogid)
{
case LOGIN:
{
if(!response)
{
Kick(playerid);
}
if(strcmp(pInfo[playerid][Pass], inputtext, true, 128) == 0)
{
format(Query, sizeof(Query), "SELECT * FROM `usuarios` WHERE `Nombre` = '%s'", pName);
mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 1, playerid);
SetPlayerScore(playerid, pInfo[playerid][Scores]);
}
else
{
SendClientMessage(playerid, -1, "CONTRASEСA INCORRECTA");
Kick(playerid);
}
}
case REGISTRO:
{
if(!response)
{
SendClientMessage(playerid, -1, "Kicked");
Kick(playerid);
}
if(response)
{
if(!strlen(inputtext))
{
Kick(playerid);
}
new password[32];
format(password, sizeof(password), "%s", inputtext); pInfo[playerid][Pass] = password;
format(Query, sizeof(Query), "INSERT INTO `usuarios` (Nombre, Pass) VALUES ('%s','%s')",pName, pInfo[playerid][Pass]);
mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 0, playerid);
format(string, sizeof(string), "Has registrado el personaje %s en nuestro servidor.\n\nAhora inicia sesiуn", pName);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD,"Iniciar sesiуn",string,"Enviar","Salir");
}
}
}
}