Player connect problems. -
Anthonyx3' - 09.01.2011
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
Re: Player connect problems. -
John_F - 09.01.2011
https://sampforum.blast.hk/showthread.php?tid=167937
Re: Player connect problems. -
Anthonyx3' - 09.01.2011
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
Re: Player connect problems. -
John_F - 09.01.2011
Didn't realize you mentioned mysql.
Sorry for trying to help -.-"
Re: Player connect problems. -
California - 09.01.2011
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;
}
Re: Player connect problems. -
Anthonyx3' - 09.01.2011
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
Re: Player connect problems. -
California - 09.01.2011
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.
Re: Player connect problems. -
John_F - 09.01.2011
No. It's setting the acc found of not. use double == for conditions
Re: Player connect problems. -
Anthonyx3' - 09.01.2011
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.
Re: Player connect problems. -
California - 09.01.2011
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.