SA-MP Forums Archive
Name Lengh Problem! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Name Lengh Problem! (/showthread.php?tid=470702)



Name Lengh Problem! - Akcent_Voltaj - 19.10.2013

FIXED!


Re: Name Lengh Problem! - DanishHaq - 19.10.2013

Ok and the code? Do we guess that again?


Re: Name Lengh Problem! - Misiur - 19.10.2013

Too small buffer, too small field in database, or username search using "like" instead of exact search. There are tons of possibilities. You need to debug your code, drop some print statements around and check where the problem is.


Re: Name Lengh Problem! - Akcent_Voltaj - 19.10.2013

FIXED!


Re: Name Lengh Problem! - popben - 19.10.2013

Well lets start.

1. Your "Loginstring" has to much of a high variable.

Change new loginstring[500]; to new loginstring[128];

2. Same story for Loginname.

Change new loginname[100]; to new loginname[64]; (64 is fine for any normal name.)

Hope this helped you


Re: Name Lengh Problem! - Misiur - 19.10.2013

In fact, use MAX_PLAYER_NAME + 1 for loginname.

Now, first of all, when you are using string without any parameters inside, then don't use format.

pawn Код:
if (gPlayerAccount[playerid] != 0)
{
    new
        loginstring[128],
        loginname[MAX_PLAYER_NAME + 1];

    GetPlayerName(playerid,loginname,sizeof(loginname));
    TextDrawShowForPlayer(playerid, TextdrawConnect2);
    TextDrawShowForPlayer(playerid, TextdrawConnect3);
    format(loginstring,sizeof(loginstring),"{FFFFFF}Salut, {2F991A}%s {FFFFFF}Ai deja un cont pe Comunitatea Union-Zone!",loginname);
    SendClientMessage(playerid, COLOR_WHITE, loginstring);
    ShowPlayerDialog(playerid,12346,DIALOG_STYLE_PASSWORD,"Login","Acest cont este inregistrat.Te poti loga!","Login","Exit");
}
And the problem is somewhere else, not here.


Re: Name Lengh Problem! - Akcent_Voltaj - 19.10.2013

BUMP SORRY


Re: Name Lengh Problem! - Akcent_Voltaj - 19.10.2013

FIXED!