case DIALOG_LOGIN: {
if( response )
{
if( !strlen( inputtext ) ) //They hit enter without entering a password.
return ShowPlayerDialog( playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Welcome to SA:MP - Zone DM!", "\n\nYou have entered an invalid password, in order to assist you, a plain text password field has been enabled.\n\nPlease enter a password in order to register an account with us.", "Submit", "Quit" );
if( !strcmp( accInfo [ playerid ] [ Password ], inputtext, false ) )
return ShowPlayerDialog( playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Welcome to SA:MP - Zone DM!", "\n\nYou have entered an invalid password, in order to assist you, a plain text password field has been enabled.\n\nPlease enter a password in order to register an account with us.", "Submit", "Quit" );
INI_ParseFile( GetAccountPath( playerid ), "LoadUser_%s", .bExtra = true, .extra = playerid );
GivePlayerMoney( playerid, 1000 );
}
}
#define USERPATH "ZoneDM/Users/%s.ini"
enum accVars
{
Password[ 64 ],
Model,
Access,
ClassID
};
new accInfo [ MAX_PLAYERS ] [ accVars ], bool:player_Logged[ MAX_PLAYERS ] = false;
public OnPlayerConnect(playerid)
{
if( fexist( GetAccountPath( playerid ) ) ) //They exist!
{
INI_ParseFile( GetAccountPath( playerid ), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Welcome to SA:MP - Zone DM!", "\n\nPlease enter your password below to be logged in.", "Submit", "Quit" );
}
else //New user
{
ShowPlayerDialog( playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Welcome to SA:MP - Zone DM!", "\n\nPlease enter a password in order to register an account with us.", "Submit", "Quit" );
}
player_Spawned [ playerid ] = false, player_Logged [ playerid ] = false;
return 1;
}
switch( dialogid )
{
case DIALOG_BLANK: { if( response ) { } }
case DIALOG_REGISTER: {
if( response )
{
if( !strlen( inputtext ) ) //They hit enter without entering a password.
return ShowPlayerDialog( playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Welcome to SA:MP - Zone DM!", "\n\nYou have entered an invalid password, in order to assist you, a plain text password field has been enabled.\n\nPlease enter a password in order to register an account with us.", "Submit", "Quit" );
new
INI: myAcc = INI_Open( GetAccountPath( playerid ) );
INI_SetTag( myAcc, "data" );
INI_WriteString( myAcc, "Password", inputtext );
INI_WriteInt( myAcc, "Model", -1 );
INI_WriteInt( myAcc, "Access", 1 );
INI_WriteInt( myAcc, "ClassID", -1 );
INI_Close( myAcc );
}
else if( !response )
{
SendClientMessage( playerid, 0xFFFFFFFF, "You have chosen to quit the server. We hope you visit again soon!" );
Kick( playerid );
}
}
case DIALOG_LOGIN: {
if( response )
{
if( !strlen( inputtext ) ) //They hit enter without entering a password.
return ShowPlayerDialog( playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Welcome to SA:MP - Zone DM!", "\n\nYou have entered an invalid password, in order to assist you, a plain text password field has been enabled.\n\nPlease enter a password in order to register an account with us.", "Submit", "Quit" );
if( strcmp( accInfo[ playerid ] [ Password ], inputtext, false ) == 0 )
return ShowPlayerDialog( playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Welcome to SA:MP - Zone DM!", "\n\nYou have entered an invalid password, in order to assist you, a plain text password field has been enabled.\n\nPlease enter a password in order to register an account with us.", "Submit", "Quit" );
INI_ParseFile( GetAccountPath( playerid ), "LoadUser_%s", .bExtra = true, .extra = playerid );
player_Logged [ playerid ] = true;
GivePlayerMoney( playerid, 1000 );
}
}
}
if( !strcmp( accInfo [ playerid ] [ Password ], inputtext, false ) )
return ShowPlayerDialog( playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, etc....
if(strcmp(string,string2,true) == 0)
if( strcmp( accInfo [ playerid ] [ Password ], inputtext, false ) != 0 )
return ShowPlayerDialog( playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, etc....
[11:34:30] Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID |
case DIALOG_LOGIN: {
if( response )
{
if( !strlen( inputtext ) ) //They hit enter without entering a password.
return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Welcome to SA:MP - Zone DM!", "\n\nYou have entered an invalid password, in order to assist you, a plain text password field has been enabled.\n\nPlease enter your password below to be logged in.", "Submit", "Quit" );
if( strcmp( accInfo[ playerid ] [ Password ], inputtext, false ) )
return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Welcome to SA:MP - Zone DM!", "\n\nYou have entered an invalid password, in order to assist you, a plain text password field has been enabled.\n\nPlease enter your password below to be logged in.", "Submit", "Quit" );
INI_ParseFile( GetAccountPath( playerid ), "LoadUser_%s", .bExtra = true, .extra = playerid );
player_Logged [ playerid ] = true;
SpawnPlayer( playerid );
GivePlayerMoney( playerid, 9999999 );
}
else if( !response )
{
SendClientMessage( playerid, 0xFFFFFFFF, "You have chosen to quit the server. We hope you visit again soon!" );
Kick( playerid );
}
}
if( strcmp( accInfo[ playerid ] [ Password ], inputtext, false ) )
return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT
!= 0
But
pawn Code:
Code:
!= 0 |
if( strcmp( accInfo[ playerid ] [ Password ], inputtext, false ) )
return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT
I'm lost then.
It works fine in game, but just prints that message? These sorta things I just fiddle around with something until the message goes away. Couldn't find anything on it on ****** or the search button. |
You both did, thank you. I'll +rep you momentarily. I have another question... I just got the following printed in my server console, I've never seen it before..
The code: pawn Code:
|