Jump to content
  • 0

Ajutor /addemail


SkyLeAs

Question

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

 

Inlocuieste 


mysql_real_escape_string( lsMail, lsMail );

cu


mysql_real_escape_string( inputtext, lsMail );

si poti pune si lsMail mai mare:


new lsMail[128];

 

 


new lsMail[29];

e prea mic acest string, pune in paranteza alt numar mai mare.De prefereat peste 150 . Sau cum spunea @andy47ish  128.

 

La fel imi arata.

Link to comment
Share on other sites

  • 0
if(dialogid == DIALOG_SET_EMAIL)
	{
		new lsMail[29];
		mysql_real_escape_string( inputtext, lsMail );
		format(gsQuery, 256, "UPDATE `Accounts` SET `E-Mail` = '%s' WHERE `Key` = %d", inputtext, PlayerInfo[ playerid ][ AccID ] );
		mysql_function_query(g_Handle,gsQuery,false,"","");
		format(PlayerInfo[playerid],128,"%s",inputtext);
		SendClientMessage(playerid,-1,"{FFFFFF}Your {FFB400}E-Mail Account{FFFFFF} has been set{FFB400}!");
		return (1);
	}
Link to comment
Share on other sites

  • 0

if(dialogid == DIALOG_SET_EMAIL)
	{
		new lsMail[29];
		mysql_real_escape_string( inputtext, lsMail );
		format(gsQuery, 256, "UPDATE `Accounts` SET `E-Mail` = '%s' WHERE `Key` = %d", inputtext, PlayerInfo[ playerid ][ AccID ] );
		mysql_function_query(g_Handle,gsQuery,false,"","");
		format(PlayerInfo[playerid],128,"%s",inputtext);
		SendClientMessage(playerid,-1,"{FFFFFF}Your {FFB400}E-Mail Account{FFFFFF} has been set{FFB400}!");
		return (1);
	}

La fel :|

Link to comment
Share on other sites

  • 0

Incearca asa: 

if(dialogid == DIALOG_SET_EMAIL)
{
new lsMail[128];
   if (sscanf(inputtext, "s[256]", lsMail))
     {
      if(PlayerInfo[playerid][Language]==0)
{
ShowPlayerDialog( playerid, DIALOG_SET_EMAIL, DIALOG_STYLE_INPUT, "E-Mail Set", "{FFFFFF}Hi !nThis server request to each user have set his e-mail, for differite reasonsn{FF0000}Please type your e-mail below:", "Set", "" );
}
if(PlayerInfo[playerid][Language]==1)
{
ShowPlayerDialog( playerid, DIALOG_SET_EMAIL, DIALOG_STYLE_INPUT, "E-Mail Set", "{FFFFFF}Buna !nAcest server are nevoie sa iti setezi e-mailul contului tau, pentru diferite motiive.n{FF0000}Te rugam, scrie-ti e-mailul:", "Set", "" );
}
    }
      if (strlen(lsMail) < 8 || strlen(lsMail) > 60) return ShowPlayerDialog( playerid, DIALOG_SET_EMAIL, DIALOG_STYLE_INPUT, "E-Mail Set", "{FFFFFF}Buna !nAcest server are nevoie sa iti setezi e-mailul contului tau, pentru diferite motiive.n{FF0000}Te rugam, scrie-ti e-mailul:", "Set", "" );
if (strfind(lsMail, "@", false) == -1 || strfind(lsMail, ".", false) == -1) return ShowPlayerDialog( playerid, DIALOG_SET_EMAIL, DIALOG_STYLE_INPUT, "E-Mail Set", "{FFFFFF}Buna !nAcest server are nevoie sa iti setezi e-mailul contului tau, pentru diferite motiive.n{FF0000}Te rugam, scrie-ti e-mailul:", "Set", "" );
mysql_real_escape_string(lsMail, lsMail);
format(gsQuery, 256, "UPDATE `Accounts` SET `E-Mail` = '%s' WHERE `Key` = %d", lsMail, PlayerInfo[playerid][AccID]);
mysql_function_query(g_Handle, gsQuery, false, "", "");
format(PlayerInfo[playerid], 128, "%s", lsMail);
return (1);
}

Ocupation: Youtube, Mined Bitcoin's, Scripting & Mapping SA:MP

Link to comment
Share on other sites

  • 0

 

Incearca asa: 

if(dialogid == DIALOG_SET_EMAIL)
{
new lsMail[128];
   if (sscanf(inputtext, "s[256]", lsMail))
     {
      if(PlayerInfo[playerid][Language]==0)
{
ShowPlayerDialog( playerid, DIALOG_SET_EMAIL, DIALOG_STYLE_INPUT, "E-Mail Set", "{FFFFFF}Hi !nThis server request to each user have set his e-mail, for differite reasonsn{FF0000}Please type your e-mail below:", "Set", "" );
}
if(PlayerInfo[playerid][Language]==1)
{
ShowPlayerDialog( playerid, DIALOG_SET_EMAIL, DIALOG_STYLE_INPUT, "E-Mail Set", "{FFFFFF}Buna !nAcest server are nevoie sa iti setezi e-mailul contului tau, pentru diferite motiive.n{FF0000}Te rugam, scrie-ti e-mailul:", "Set", "" );
}
    }
      if (strlen(lsMail) < 8 || strlen(lsMail) > 60) return ShowPlayerDialog( playerid, DIALOG_SET_EMAIL, DIALOG_STYLE_INPUT, "E-Mail Set", "{FFFFFF}Buna !nAcest server are nevoie sa iti setezi e-mailul contului tau, pentru diferite motiive.n{FF0000}Te rugam, scrie-ti e-mailul:", "Set", "" );
if (strfind(lsMail, "@", false) == -1 || strfind(lsMail, ".", false) == -1) return ShowPlayerDialog( playerid, DIALOG_SET_EMAIL, DIALOG_STYLE_INPUT, "E-Mail Set", "{FFFFFF}Buna !nAcest server are nevoie sa iti setezi e-mailul contului tau, pentru diferite motiive.n{FF0000}Te rugam, scrie-ti e-mailul:", "Set", "" );
mysql_real_escape_string(lsMail, lsMail);
format(gsQuery, 256, "UPDATE `Accounts` SET `E-Mail` = '%s' WHERE `Key` = %d", lsMail, PlayerInfo[playerid][AccID]);
mysql_function_query(g_Handle, gsQuery, false, "", "");
format(PlayerInfo[playerid], 128, "%s", lsMail);
return (1);
}

Nici asa nu merge.

Link to comment
Share on other sites

  • 0

mysql_query(g_Handle,gsQuery); in loc de mysql_function_query

Nu mai incurajati folosirea mysql_query ! Este ineficient, si nu are nici o treaba aici.

 

Pasi:

1. Inlocuieste tot acel cod de la raspunsul dialogului cu acesta, l-am optimizat cat se poate si am corectat tot ce trebuia: 

if( dialogid == DIALOG_SET_EMAIL )
{
    // te rog sa schimbi marimea "64" cu marimea variabilei PlayerInfo[ playerid ][ EMail ].
    if( strlen( inputtext ) > 64 ) // 64 aici
        return SendClientMessage( playerid, -1, "E-Mailul inserat este mult prea lung !" );

    new lsMail[ 64 ]; // 64 aici
    mysql_real_escape_string( inputtext, lsMail );

    PlayerInfo[ playerid ][ EMail ][ 0 ] = EOS;
    strcat( PlayerInfo[ playerid ][ EMail ], lsMail, 64 ); // 64 aici

    SendClientMessage( playerid, -1, "Your {FFB400}E-Mail Account{FFFFFF} has been set {FFB400}!" );

    format( gsQuery, 256, "UPDATE `Accounts` SET `E-Mail` = '%s' WHERE `Key` = %d", lsMail, PlayerInfo[ playerid ][ AccID ] );
    mysql_function_query( g_Handle, gsQuery, false, "", "" );
    return 1;
}
2. Compileaza.

3. Verifica iar comanda pe server.

4. Primesti mesajul ca s-a modificat E-Mailul ?

- Daca nu, atunci iti recomand sa schimbi ID-ul dialogului DIALOG_SET_EMAIL, este posibil sa mai ai un dialog cu acelasi ID.

- Daca da:

-- verifica daca variabila PlayerInfo[playerid] este afisata corect, de exemplu afiseaza-i intr-o comanda simpla E-Mailul (acea variabila).

-- asigura-te ca nu sunt prezente erori la executarea acelui query de updatare a E-Mailului in cont. (poti vedea prin loguri)

-- asigura-te ca nu exista nici un alt loc in care se poate schimba E-Mailul automat.

Edited by ![]stuntman[]!
  • Upvote 2
Link to comment
Share on other sites

  • 0

Nu mai incurajati folosirea mysql_query ! Este ineficient, si nu are nici o treaba aici.

 

Pasi:

1. Inlocuieste tot acel cod de la raspunsul dialogului cu acesta, l-am optimizat cat se poate si am corectat tot ce trebuia: 

if( dialogid == DIALOG_SET_EMAIL )
{
    // te rog sa schimbi marimea "64" cu marimea variabilei PlayerInfo[ playerid ][ EMail ].
    if( strlen( inputtext ) > 64 ) // 64 aici
        return SendClientMessage( playerid, -1, "E-Mailul inserat este mult prea lung !" );

    new lsMail[ 64 ]; // 64 aici
    mysql_real_escape_string( inputtext, lsMail );

    PlayerInfo[ playerid ][ EMail ][ 0 ] = EOS;
    strcat( PlayerInfo[ playerid ][ EMail ], lsMail, 64 ); // 64 aici

    SendClientMessage( playerid, -1, "Your {FFB400}E-Mail Account{FFFFFF} has been set {FFB400}!" );

    format( gsQuery, 256, "UPDATE `Accounts` SET `E-Mail` = '%s' WHERE `Key` = %d", lsMail, PlayerInfo[ playerid ][ AccID ] );
    mysql_function_query( g_Handle, gsQuery, false, "", "" );
    return (1);
}
2. Compileaza.

3. Verifica iar comanda pe server.

4. Primesti mesajul ca s-a modificat E-Mailul ?

- Daca nu, atunci iti recomand sa schimbi ID-ul dialogului DIALOG_SET_EMAIL, este posibil sa mai ai un dialog cu acelasi ID.

- Daca da:

-- verifica daca variabila PlayerInfo[playerid] este afisata corect, de exemplu afiseaza-i intr-o comanda simpla E-Mailul (acea variabila).

-- asigura-te ca nu sunt prezente erori la executarea acelui query de updatare a E-Mailului in cont. (poti vedea prin loguri)

-- asigura-te ca nu exista nici un alt loc in care se poate schimba E-Mailul automat.

 

Voi reveni cu un edit maine

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.