SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Tutorials (https://forum.sa-mp.com/forumdisplay.php?f=70)
-   -   [Tutorial] Login and Register System - Dialogs - Using Y_INI (https://forum.sa-mp.com/showthread.php?t=273088)

Tony213 31/07/2011 10:56 AM

Re: Login and Register System - Dialogs - Using Y_INI
 
Wow really nice... ima go and try to learn this y_ini

Jack_Leslie 01/08/2011 12:10 AM

Re: Login and Register System - Dialogs - Using Y_INI
 
Finally a decent y_ini tutorial, keep up the good work!

Kush 01/08/2011 12:21 AM

Re: Login and Register System - Dialogs - Using Y_INI
 
Quote:

Originally Posted by Jack_Leslie (Post 1321486)
Finally a decent y_ini tutorial, keep up the good work!

Thanks!

963852741 01/08/2011 01:16 PM

Re: Login and Register System - Dialogs - Using Y_INI
 
Yay, I am using it (also edited)
thanks, Kush

Dan. 01/08/2011 02:12 PM

Re: Login and Register System - Dialogs - Using Y_INI
 
Huh, hello again Kush, I keep having problems with your REGISTER/LOGIN scripts, take a look at this:

pawn Code:
(242) : error 017: undefined symbol "UserPath"
(244) : error 017: undefined symbol "UserPath"
(245) : error 017: undefined symbol "DIALOG_LOGIN"
(245) : warning 215: expression has no effect
(245) : error 001: expected token: ";", but found "-string-"
(245) : warning 215: expression has no effect
(245) : error 001: expected token: "-string end-", but found "-identifier-"
(245) : fatal error 107: too many error messages on one line

And here are the lines:

pawn Code:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid))) // 242
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); // 244
       ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit"); //245
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}

I guess the errors are because DIALOG_LOGIN and UserPath are not defined, but take a look at this:

pawn Code:
// Register system things
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4

#define UserPath "/Users/%s.ini"

The #define UserPath was "PATH" before.. changed it but still the same thing, so maybe you could help. And dont offer me your pastebin version, not going to copy my whole script into there, so some help, please.

Snowman12 01/08/2011 03:07 PM

Re: Login and Register System - Dialogs - Using Y_INI
 
Nice tutorial but i dont know if i missed anything but when the player registers he can play once logged in but when he goes t login a second time the password come up wrong time and time again can you help?

Thanks

Shockey HD 01/08/2011 05:35 PM

Re: Login and Register System - Dialogs - Using Y_INI
 
Quote:

Originally Posted by Snowman12 (Post 1322328)
Nice tutorial but i dont know if i missed anything but when the player registers he can play once logged in but when he goes t login a second time the password come up wrong time and time again can you help?

Thanks

Are you sure you have your scriptfile correctly?

Shockey HD 01/08/2011 05:39 PM

Re: Login and Register System - Dialogs - Using Y_INI
 
Quote:

Originally Posted by Dan. (Post 1322241)
Huh, hello again Kush, I keep having problems with your REGISTER/LOGIN scripts, take a look at this:

pawn Code:
(242) : error 017: undefined symbol "UserPath"
(244) : error 017: undefined symbol "UserPath"
(245) : error 017: undefined symbol "DIALOG_LOGIN"
(245) : warning 215: expression has no effect
(245) : error 001: expected token: ";", but found "-string-"
(245) : warning 215: expression has no effect
(245) : error 001: expected token: "-string end-", but found "-identifier-"
(245) : fatal error 107: too many error messages on one line

And here are the lines:

pawn Code:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid))) // 242
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); // 244
       ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit"); //245
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}

I guess the errors are because DIALOG_LOGIN and UserPath are not defined, but take a look at this:

pawn Code:
// Register system things
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4

#define UserPath "/Users/%s.ini"

The #define UserPath was "PATH" before.. changed it but still the same thing, so maybe you could help. And dont offer me your pastebin version, not going to copy my whole script into there, so some help, please.


I will show you mine.

pawn Code:
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4

#define PATH "/Users/%s.ini"

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTBLUE 0x00BFFFFF

pawn Code:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}

Make sure you have your includes correct.

pawn Code:
#include <YSI\y_ini>

Only an idiot cant fuck this up.

Kush 01/08/2011 06:11 PM

Re: Login and Register System - Dialogs - Using Y_INI
 
Quote:

Originally Posted by Dan. (Post 1322241)
Huh, hello again Kush, I keep having problems with your REGISTER/LOGIN scripts, take a look at this:

pawn Code:
(242) : error 017: undefined symbol "UserPath"
(244) : error 017: undefined symbol "UserPath"
(245) : error 017: undefined symbol "DIALOG_LOGIN"
(245) : warning 215: expression has no effect
(245) : error 001: expected token: ";", but found "-string-"
(245) : warning 215: expression has no effect
(245) : error 001: expected token: "-string end-", but found "-identifier-"
(245) : fatal error 107: too many error messages on one line

And here are the lines:

pawn Code:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid))) // 242
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); // 244
       ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit"); //245
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}

I guess the errors are because DIALOG_LOGIN and UserPath are not defined, but take a look at this:

pawn Code:
// Register system things
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4

#define UserPath "/Users/%s.ini"

The #define UserPath was "PATH" before.. changed it but still the same thing, so maybe you could help. And dont offer me your pastebin version, not going to copy my whole script into there, so some help, please.

The main idea for this tutorial was to explain the uses of each method used, including the different callbacks, functions, and responses. This is the same tutorial as my SII, only it's done in Y_INI and a few things has been changed. Either download the .pwn and see how everything is placed, or actually READ what I have written.

jot16 02/08/2011 05:01 AM

Re: Login and Register System - Dialogs - Using Y_INI
 
I got this error.
Quote:

C:\Users\Jot\Desktop\SAMP Server\gamemodes\Banda.pwn(4) : fatal error 100: cannot read from file: "YSI\y_ini"

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
here are my includes.

http://i.imgur.com/7z3mE.jpg
http://i.imgur.com/sEffX.jpg


All times are GMT. The time now is 09:24 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.