Need Help In Register/Login System
#1

Hello,

can anyone help me to create a register & login system for me please

i will +rep you
Reply
#2

MySQL: https://sampforum.blast.hk/showthread.php?tid=574714
Y_INI: https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#3

i tried Y_INI But it shows me some errors

Код:
C:\Users\Administrator\Desktop\Freeroam\gamemodes\freeroam.pwn(82) : error 017: undefined symbol "UserPath"
C:\Users\Administrator\Desktop\Freeroam\gamemodes\freeroam.pwn(84) : error 017: undefined symbol "UserPath"
C:\Users\Administrator\Desktop\Freeroam\gamemodes\freeroam.pwn(85) : error 017: undefined symbol "DIALOG_LOGIN"
C:\Users\Administrator\Desktop\Freeroam\gamemodes\freeroam.pwn(85) : error 017: undefined symbol "COL_WHITE"
C:\Users\Administrator\Desktop\Freeroam\gamemodes\freeroam.pwn(85) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\Freeroam\gamemodes\freeroam.pwn(85) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Administrator\Desktop\Freeroam\gamemodes\freeroam.pwn(85) : fatal error 107: too many error messages on one line
85Line
Код:
	ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
84Line
Код:
	INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
82 line

Код:
	if(fexist(UserPath(playerid)))
Reply
#4

You posted again in the wrong section. If you have errors post them and wait for help, otherwise follow the tutorial one more time to make sure that you didn't messed the code up.
Reply
#5

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
You posted again in the wrong section. If you have errors post them and wait for help, otherwise follow the tutorial one more time to make sure that you didn't messed the code up.
cant you see the code which i posted
Reply
#6

You forgot some parts of the tutorial. Re-read it. Here's the fix for the UserPath error:

PHP код:
UserPath(playerid)
{
    new
        
playername[MAX_PLAYER_NAME],
        
string[50];
    
format(stringsizeof(string), PATHplayername);
    return 
string;

You didn't define DIALOG_LOGIN and COL_WHITE.

PHP код:
#define DIALOG_LOGIN 2
#define COL_WHITE "{FFFFFF}" 
Reply
#7

i have defined colo_white and login
Reply
#8

Quote:
Originally Posted by kyriakos587
Посмотреть сообщение
i have defined colo_white and login
Where did you define them? And could you show me the corresponding code?
Reply
#9

i added this in the top of the script

Код:
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4

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

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"

enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    return 1;
}

stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

/*Credits to Dracoblue*/
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
Reply
#10

Make your own. Don't be lazy and certainly don't expect any help if you don't provide code yourself.

There are many scripts on the forums that provide what you are looking for. Learn to use the search function.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)