MySql Prob.
#6

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
I asked another person to script it but he told me to ask in forums about to prob. will try what u say.
What is the one causing Problems?

EDIT:
pawn Код:
public CheckAccount(playerid, account[])
{
    new rows, field;
    cache_get_data(rows, field);
    if(rows>=1)
    {
        ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Welcome back","Welcome back to Contract Wars!\n\nType in your password below to login","Login","Leave");
        accountExists[playerid] = true;
    }
    else
    {
        ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, "New account","Please input your password below to register a account","Register","Leave");
        accountExists[playerid] = false;
    }
    return 1;
}
public CheckAccountEx(account[])
{
    new rows, field;
    cache_get_data(rows, field);
    if(rows >= 1) { QueryState = true; }
    else { QueryState = false; }
    return QueryState;
}
cache_get_data comes in these two lines.
line 359-382

Edit: If i use cache_get_row_count(), it says error 017: undefined symbol "cache_get_row_count"
pawn Код:
if(rows >= 1) // Nah, no need to do like this.

if(rows) // There are rows found!

if(!rows) // No rows found!

// OR

if(rows)
{
    // Found rows
}
else
{
    // No rows found
}

// If you really want to use the cache_get_data, just simply.

new rows, field;
cache_get_data(rows, field);
#undef fields
// OR if you're getting fields so
#undef rows

// Little bit simplifying your CheckAccountEx function

public CheckAccountEx(account[])
{
    new rows, field;
    cache_get_data(rows, field);
    #undef field
    if(rows)
        QueryState = true;
    else
        QueryState = false;
    return (QueryState ? true : false); // IDK, maybe just return QueryState. (Not needed this I guess)
}
Are you REALLY sure that you are using the latest release of BlueG's plugin R38?
https://github.com/pBlueG/SA-MP-MySQL/releases

Eh, you don't need to do this "accountExists[playerid]" variable at all. You can just simply get the rows and save them to the player variables instead of doing that afterwards. Waste of memory.
Reply


Messages In This Thread
MySql Prob. - by newbie scripter - 17.04.2014, 13:01
Re: MySql Prob. - by newbie scripter - 18.04.2014, 05:27
Re: MySql Prob. - by Conradus - 18.04.2014, 06:55
Re: MySql Prob. - by iZN - 18.04.2014, 07:10
Re: MySql Prob. - by newbie scripter - 18.04.2014, 08:09
Re: MySql Prob. - by iZN - 18.04.2014, 10:21
Re: MySql Prob. - by newbie scripter - 21.04.2014, 10:32
Re: MySql Prob. - by RajatPawar - 21.04.2014, 10:35
Re: MySql Prob. - by newbie scripter - 21.04.2014, 10:39
Re: MySql Prob. - by newbie scripter - 22.04.2014, 11:34

Forum Jump:


Users browsing this thread: 3 Guest(s)