Register System problem
#1

Hello guys I have one problem.I have register system with Dini and why when I register with nick Pein and when I reconnect with nickname peiN it says I need to register this nickname again ?
Reply
#2

Isn't that a good thing?
Reply
#3

Yes, this is problem.I want to make regardless of the letters to let you to login not to register again ...
Reply
#4

He means by IP adress, So no matter what name it logs u in with your old stats.
Reply
#5

I will try to explain:

Player [NCS]Pein join to my server and attemps to register.Then he make 5 kills nad then he left.Then he join with nick [NCS]PeiN and the server says you need to register but with [NCS]Pein he is registered.How I can fix this bug ?
Reply
#6

Quote:
Originally Posted by cs_waller
Посмотреть сообщение
I will try to explain:

Player [NCS]Pein join to my server and attemps to register.Then he make 5 kills nad then he left.Then he join with nick [NCS]PeiN and the server says you need to register but with [NCS]Pein he is registered.How I can fix this bug ?
Is not a bug.Your login system is case sensitive so if i join with Logitech90,and again with LogItech90,i've to register,like you said.

You can make a check between the ips,if there are same,make it login,else let it register.

Ex: Logitech90 has ip 192.168.1.1 - I quit,i re-enter with LogItech90 (different nick) but same ip,compare between this ips and let it login.
Reply
#7

You should make the createfile-function in the "OnDialogResponse" in stead of "OnPlayerConnect".
Reply
#8

I believe it has something to do with your scriptfiles folder. Go to scriptfiles folder and add a new folder named "Users", then add this:

Go to pawno folder, then go to includes and check if you have the following. utils.inc, float.inc, dutils.inc, Dini.inc
Then add this to the top of the script:

pawn Код:
#include <a_samp>
#include <utils>
#include <Dini>
#include <dutils>
and this to OnPlayerRegister.

pawn Код:
public OnPlayerRegister(playerid, password[])
{
    if(IsPlayerConnected(playerid))
    {
        new string3[64];
        new playername3[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername3, sizeof(playername3));

        format(string3, sizeof(string3), "Users/%s.ini", playername3);

        dini_Create(string3);
        new password2 = num_hash(password);
        PlayerInfo[playerid][pKey] = password2;
        dini_IntSet(string3, "Password",password2);
        dini_IntSet(string3, "AdminLevel",PlayerInfo[playerid][pAdmin]);
        dini_IntSet(string3, "Registered",PlayerInfo[playerid][pAdmin]);
        if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
        {
            PlayerInfo[playerid][pPos_x] = 1684.9;
            PlayerInfo[playerid][pPos_y] = -2244.5;
            PlayerInfo[playerid][pPos_z] = 13.5;
        }
        dini_FloatSet(string3, "Pos_x",PlayerInfo[playerid][pPos_x]);
        dini_FloatSet(string3, "Pos_y",PlayerInfo[playerid][pPos_y]);
        dini_FloatSet(string3, "Pos_z",PlayerInfo[playerid][pPos_z]);
        dini_IntSet(string3, "Banned",PlayerInfo[playerid][pBanned]);
        ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Welcome to <insert server name>", "Your account is now registered.\n\nIn order to play here, you need to log in!", "Login", "Quit");
        PlayerInfo[playerid][pReg] = 0;
    }
    return 1;
}
Hope I helped.
Reply
#9

My server is on Linux and when I start the server on the Windows I dont have this bug all is okay but when I start the server on the linux and when I join with [NCS]PeiN I need to register and files in scriptfiles doesn't replace
Reply
#10

No, I know exately what it is, I made same mistake when I was learning scripting, because i followed a tutorial. Just do what I said above, then it will work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)