Player connect problems.
#1

Alright guys, ive been stressing out on this for a bit now.

pawn Код:
if(CheckAccountExists(UserStats[playerid][Name])) AccountExists[playerid] = 1;
    else AccountExists[playerid] = 0;
This is my current on player connect, checking if player acc exists or not. I want to make it send a dialog, if player exist, then show login, if player doesnt, show register. Ive tried and failed.

My gm is scripted in mysql, if that helps at all. I would be very grateful for whoever helps me, thanks.


-Anthony
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=167937
Reply
#3

I know how to do dini, mysql is different, thanks for posting something that really didnt help. i threw the words scripted in mysql for a reason
Reply
#4

Didn't realize you mentioned mysql.
Sorry for trying to help -.-"
Reply
#5

Quote:
Originally Posted by John_F
Посмотреть сообщение
He's trying to learn, he doesn't want to use that method of storing data. Please read better.

pawn Код:
if(CheckAccountExists(UserStats[playerid][Name]))
{
    AccountExists[playerid] = 1;
    // Use ShowPlayerDialog then OnPlayerDialog to call the dialogid.
    else
    {
        AccountExists[playerid] = 0;
        // Use ShowPlayerDialog then OnPlayerDialog to call the dialogid.
        return 1;
     }
     return 1;
}
Reply
#6

Quote:
Originally Posted by John_F
Посмотреть сообщение
Didn't realize you mentioned mysql.
Sorry for trying to help -.-"
I thank you for that, i apologize if my reply sounded wrong, it wasnt intended to.

Quote:
Originally Posted by California
Посмотреть сообщение
He's trying to learn, he doesn't want to use that method of storing data. Please read better.

pawn Код:
if(CheckAccountExists(UserStats[playerid][Name]))
{
    AccountExists[playerid] = 1;
    // Use ShowPlayerDialog then OnPlayerDialog to call the dialogid.
    else
    {
        AccountExists[playerid] = 0;
        // Use ShowPlayerDialog then OnPlayerDialog to call the dialogid.
        return 1;
     }
     return 1;
}
Alright, ill try it this way even tho last time i tried, it didnt work. Also, this question might sound stupid, is it checking for accountexist =0 or 1, or is it setting if acc found, or not?




-Anthony
Reply
#7

Quote:
Originally Posted by Anthonyx3'
Посмотреть сообщение
I thank you for that, i apologize if my reply sounded wrong, it wasnt intended to.



Alright, ill try it this way even tho last time i tried, it didnt work. Also, this question might sound stupid, is it checking for accountexist =0 or 1, or is it setting if acc found, or not?




-Anthony
It's checking whether the account is found or not, using CheckAccountExists. That script must have an if statement for the AccountExist variable.
Reply
#8

No. It's setting the acc found of not. use double == for conditions
Reply
#9

pawn Код:
public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, UserStats[playerid][Name], MAX_PLAYER_NAME);

    if(CheckAccountExists(UserStats[playerid][Name]))
    {
        AccountExists[playerid] = 1;
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Welcome Back To New Life Gaming", "Please Login, insert your password below", "Login", "Leave");
    else
    {
        AccountExists[playerid] = 0;
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Welcome To New Life Gaming", "Please Register, insert a password below", "Register", "Leave");
    return 1;
     }


    return 1;
}
Gives me 22 random errors.
Reply
#10

pawn Код:
public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, UserStats[playerid][Name], MAX_PLAYER_NAME);
    if(CheckAccountExists(UserStats[playerid][Name]))
    {
        AccountExists[playerid] = 1;
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Welcome Back To New Life Gaming", "Please Login, insert your password below", "Login", "Leave");
        return 1;
    }
    else if(!CheckAccountExists(UserStats[playerid][Name]))
    {
        AccountExists[playerid] = 0;
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Welcome To New Life Gaming", "Please Register, insert a password below", "Register", "Leave");
        return 1;
    }
    return 1;
}
Brackets, ugh.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)