11.11.2012, 12:40
SAMP Good friends would like to know if someone helps me with this code to get the value of a variable before running mysql if statements such as:
You see what I'm trying to do is get the value of the variable g_PlayerInfo [playerid] [pRegistrado] run so that each bone if statements if the value is 0 which launches the if (g_PlayerInfo[playerid][pRegistrado] == 0) and if it is one that lanze if (g_PlayerInfo[playerid][pRegistrado] == 1), well the problem is that I do not get the value of the default variable to 0 strip long run if (g_PlayerInfo [playerid] [pRegistrado] == 0).
PD: To understand better get the value of a variable before MySQL if statements.
Feel free to comment on any idea or example of how I can get this variable before the if statement please.
Thank you for your support.
A greeting.
Sorry for my bad English is ****** translator.
pawn Код:
forward LOGIN(playerid, dialogid, response, listitem, inputtext[]);
public LOGIN(playerid, dialogid, response, listitem, inputtext[])
{
switch( response )
{
case 0: Dialog_Show(playerid,DIALOG_STYLE_MSGBOX,"{1564F5}Administraciуn - | Warning: Kick |", "Usted ha sido kikeado del servidor por exceder las oportunidades de insertar su contraseсa correctamente.\n\nїUsted perdiу su contraseсa?\nSi usted perdiу su contraseсa ingrese a nuestro Foro:"SERVER_WEB" luego clickй en (їOlvidaste tu contraseсa?).\n\nPase buen dia, ATT: Administraciуn "SERVER_NAME".","Salir","", .dialog = DIALOG_LOGIN), Kick(playerid);
case 1:
{
new pBuffer[129];
WP_Hash(pBuffer, sizeof pBuffer, inputtext);
if(!strcmp(g_PlayerInfo[playerid][pPass], pBuffer, false))
{
new query[128];
format(query, sizeof(query), "SELECT * FROM `Registrado` = %d", g_PlayerInfo[playerid][pRegistrado]);
mysql_function_query(g_Handle, query, true, "CargarCuenta", "", playerid);
if(g_PlayerInfo[playerid][pRegistrado] == 1)
{
CargarCuenta(playerid);
}
if(g_PlayerInfo[playerid][pRegistrado] == 0)
{
Dialog_ShowCallback(playerid, using callback OnDialogResponse, DIALOG_STYLE_MSGBOX, "Registro", "Usted no ha completado el registro.\nAhora selecciona una de las siguientes opciones.\n\nїA que sexo perteneces?", "Hombre","Mujer", .dialog = DIALOG_SEXO);
}
return 0;
}
else
{
pWarning[playerid]++;
switch(pWarning[playerid])
{
case 1: Dialog_Show(playerid,DIALOG_STYLE_PASSWORD,"{1564F5}Login - | Warning 1/3 |", "Bienvenido a "SERVER_NAME".\nPor favor ingresa tu contraseсa correctamente.\nContraseсa incorrecta.\n\nContraseсa: ","Entrar","Salir", .dialog = DIALOG_LOGIN);
case 2: Dialog_Show(playerid,DIALOG_STYLE_PASSWORD,"{1564F5}Login - | Warning 2/3 |", "Bienvenido a "SERVER_NAME".\nPor favor ingresa tu contraseсa correctamente.\nContraseсa incorrecta.\n\nContraseсa: ","Entrar","Salir", .dialog = DIALOG_LOGIN);
case 3: Dialog_Show(playerid,DIALOG_STYLE_INPUT,"{1564F5}Login - | Warning 3/3 |", "Bienvenido a "SERVER_NAME".\nPor favor ingresa tu contraseсa correctamente.\nContraseсa incorrecta.\n\nContraseсa: ","Entrar","Salir", .dialog = DIALOG_LOGIN);
case 4: Dialog_Show(playerid,DIALOG_STYLE_MSGBOX,"{1564F5}Administraciуn - | Warning: Kick |", "Usted ha sido kikeado del servidor por exceder las oportunidades de insertar su contraseсa correctamente.\n\nїUsted perdiу su contraseсa?\nSi usted perdiу su contraseсa ingrese a nuestro Foro:"SERVER_WEB" luego clickй en (їOlvidaste tu contraseсa?).\n\nPase buen dia, ATT: Administraciуn "SERVER_NAME".","Salir","", .dialog = DIALOG_LOGIN), Kick(playerid);
}
return 0;
}
}
}
return 1;
}
PD: To understand better get the value of a variable before MySQL if statements.
Feel free to comment on any idea or example of how I can get this variable before the if statement please.
Thank you for your support.
A greeting.
Sorry for my bad English is ****** translator.