Jump to content
  • 0

Problema parola


Mister

Question

Problema intalnita (descriere): Salut, am facut comanda sa schimb parola si imi da eroare in mysql_log, desi pe server spune ca am schimbat parola
Ero(area / rile) / warning-(ul / urile):  in  mysql_log

mysql_tqueryOKconnection: 1, query: "UPDATE `players` SET `password`='ASD2131sda' WHERE `username`='77", callback: "(null)", format: "(null)"


Liniile de cod / sursa / script-ul(obligatoriu): 

 

Asdf2132 reprezinta parola pe care am vrut sa o pun
LIFE:changepass(playerid,params[])
{
	if(gLogged[playerid] != 1) return SendClientMessage(playerid,COLOR_RED,"Nu esti logat");
    if(aprobat[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, " Ai nevoie de aprobare de la owner!");
	new message[128];
	if(sscanf(params,"s[128]",message)) return SendClientMessage(playerid, COLOR_WHITE, "Use: /changepass [new pass]");
	if(strlen(message) <= 5 || strlen(message) > 20) return SendClientMessage(playerid, COLOR_WHITE, "{1580EA}Parola: {FFFFFF}Parola trebuie sa fie intre 5 si 20 caractere!");
	strmid(PlayerInfo[playerid][pPassword], message, 0, strlen(message), 255);
	mysql_format(handle, query, 500, "UPDATE `players` SET `password` = `%s` WHERE `username`='%s'",message, PlayerName(playerid));
	mysql_tquery(handle, query);
	aprobat[playerid] = 0;
	SendClientMessage(playerid, COLOR_WHITE, "{1580EA}Server: {FFFFFF}Ti-ai schimbat parola.");
	return 1;
}

 


Imagini / Video (optional): nu e nevoie
Ati incercat sa rezolvati singur?: inainte era asa

 

mysql_format(handle, query, 500, "UPDATE `players` SET `password` = `%s` WHERE `username`='%d'",PlayerInfo[playerid][pPassword], PlayerName(playerid));

m-am gandit ca poate in query trebuie direct ce ai scris asa ca am schimbat din  

PlayerInfo[playerid][pPassword] in message,

Este mysql r39-3 nu ma prea pricep la el, sunt obisnuit de pe R5 asta o aveam inainte dar am facut update.

 

Am gasit problema la username  era identifier %d trebuia de tip %s  am vazut la scriptul cu dialog acelasi identifier si m-am gandit de ce e si la mine la fel, asa ca mi-am dat seama

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Salut.Ti-am lasat mai jos o comanda prin care schimbi parola,o sa iti apara o fereastra.Incearca zi vezi daca functioneaza.O sa ai nevoie de include-ul ZCMD:

http://www48.zippyshare.com/v/6XDflF7O/file.html
/*
  Include-uri necesare
*/

#include <a_mysql>
#include <zcmd>

/*
  Define-uri necesare pentru dialog
*/

#define                 hidePlayerDialog(%0)                    ShowPlayerDialog(%0, -1, 0, " ", " ", "", "")

/*
  Enumeram variabila pInternalID
*/

enum playervEnum {
    pInternalID,
}

/*
  CallBack-ul pentru raspunsul dialogului
*/

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
	#if defined DEBUG
	    printf("[debug] OnDialogResponse(%d, %d, %d, %d, %s)", playerid, dialogid, response, listitem, inputtext);
	#endif
	
	if(!isnull(inputtext))
		for(new strPos; inputtext[strPos] > 0; strPos++)
			if(inputtext[strPos] == '%')
				inputtext[strPos] = '\0'; 
        case DIALOG_CHANGE_PASS:
		    {
			    if(response)
			    {
				    new string[128];
				    if(strlen(inputtext) >= 1)
				    {
					    format(playerVariables[playerid][pPassword], 255, "%s", inputtext);
					    format(string, sizeof(string), "Password changed to '%s'.", inputtext);
					    SendClientMessage(playerid, COLOR_RED, string);
					    new Str[256];
					    format(Str,256,"UPDATE `players` SET `password`='%s' WHERE `playerID`='%d'",inputtext, playerVariables[playerid][pInternalID]);
					    mysql_tquery(handle,Str);
				    }
				else return SCM(playerid,COLOR_WHITE,"The new password must been over 1 character");
			}	
		}

/*
  Comanda pentru schimbarea parolei,utilizand ZCMD
*/

CMD:changepass(playerid, params[])
{
	ShowPlayerDialog(playerid, DIALOG_CHANGE_PASS, DIALOG_STYLE_INPUT, "Password", "Please enter your new password.", "Change Pass", "Cancel");
	return 1;
}

 

Edited by ..::STeFaNN::..
  • Upvote 1
Link to comment
Share on other sites

  • 0

Asta e comanda de schimbat parola de pe gmul bugged nu o sa mearga, are multe probleme pe care nu stau sa le fac si problema mea este stringul meu, nu trebuie sa imi dai o comanda noua pentru problema mea doar sa imi zpui de ce nu citeste stringul identifierul meu si poate rezolv.

 

 

Am zis mai sus ca am rezolvat multumesc

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.