Bug in the system of registration and login.
#7

@PowerPC603: Thanks man! Now i understood the Textdraws names bug.

But, it's not just that.

See this:

pawn Код:
SetSpawnInfo(playerid, 0, Player[playerid][Skin], 822.5340, -1340.8425, 13.5182, 5.3207, 0, 0, 0, 0, 0, 0);
        SpawnPlayer(playerid);
       
        pMessage(playerid, Green, "Connected to the server. Enjoy.");
That is what appear when, for example, John connect, and this appears again to John when Marie connect.
So, John will receive that message and will spawn again.

I don't know why this happens...


Now, see this:

pawn Код:
forward LoginPlayer(playerid);
Login dialog:

[...]

pawn Код:
if(dialogid == 02)
    {
        if(response)
        {
            if(!strlen(inputtext))
            {
                new string[123];
                GetPlayerName(playerid, name, 30);
                format(string, sizeof(string), "{FFFFFF}Nick:{FFAC17} %s\n\n{FFFFFF}Enter your password to login.", name);
                ShowPlayerDialog(playerid, 02, DIALOG_STYLE_PASSWORD, "{FFAC17}Login", string, "Confirm", "Cancel");
                return 1;
            }
            else
            {
                GetPlayerName(playerid, name, 30);
                format(query, sizeof(query), "SELECT * FROM `players` WHERE `Nick` = '%s' AND `Password` = '%s'", name, inputtext);
                mysql_tquery(conexao, query, "LoginPlayer");
            }
        }
    }
pawn Код:
public LoginPlayer(playerid)
{

    if(cache_num_rows() > 0)
    {

        Player[playerid][Money] = cache_get_field_content_int(0, "Money", conexao);
        Player[playerid][Skin] = cache_get_field_content_int(0, "Skin", conexao);
        Player[playerid][Level] = cache_get_field_content_int(0, "Level", conexao);
        Player[playerid][Ip] = cache_get_field_content_int(0, "IP", conexao);
        Player[playerid][Wanted] = cache_get_field_content_int(0, "Wanted", conexao);
        Player[playerid][LevelAdm] = cache_get_field_content_int(0, "AdmLvL", conexao);
        Player[playerid][Vip] = cache_get_field_content_int(0, "Vip", conexao);
        Player[playerid][House] = cache_get_field_content_int(0, "House", conexao);
        Player[playerid][Job] = cache_get_field_content_int(0, "Job", conexao);
        Player[playerid][Vehicle] = cache_get_field_content_int(0, "Vehicle", conexao);
       
       
        CancelSelectTextDraw(playerid);
        for(new i = 0; i < sizeof(TextInicial); i ++) { TextDrawHideForPlayer(playerid, TextInicial[i]); }
        for(new i = 0; i < sizeof(TextRodape); i ++) { TextDrawShowForPlayer(playerid, TextRodape[i]); }
       
        ResetPlayerWeapons(playerid);
        ResetPlayerMoney(playerid);

        GivePlayerMoney(playerid, Player[playerid][Money]);
        SetPlayerScore(playerid, Player[playerid][Level]);
        SetPlayerWantedLevel(playerid, Player[playerid][Wanted]);

        SetSpawnInfo(playerid, 0, Player[playerid][Skin], 822.5340, -1340.8425, 13.5182, 5.3207, 0, 0, 0, 0, 0, 0);
        SpawnPlayer(playerid);
       
        pMessage(playerid, Green, "Connected to the server. Enjoy.");
       
    }
    else
    {
        new string[123];
        errors++;
        if(errors>= 5)
        {
            pMessage(playerid, Red, "You were kicked from the server by exceed the maximum errors limit.");
            SetTimer("TimerKick", 500, 0);
        }
        if(5 - errors == 0) return 0;
        format(string, sizeof(string), "Incorrect password. If you miss more %i you will be kicked from the server.", 5 - errors);
        ShowPlayerDialog(playerid, 03, DIALOG_STYLE_MSGBOX, "Error", string, "OK", "");
    }
   
    return 1;
}
I am portuguese, so i translated some things to English, but i think there is no problem. And yeah, i know that we have a board in this forum too, but you (global forum members) have more experience and qualities than just the portuguese/brazilian forum members.

Sorry for the bad english, i didn't used ****** Translator
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)