Registration command got wrong?
#1

Hey, i got a bug with my registration and login command / system.
No matter what name you connect with your account is created. If i connect with the name Niixie_Boi, the name is registered. and the pass is 123.
And the folder where the user file should be stored is empty?

I dont know whats wrong, but heres my system.

http://regi.pastebin.com/RDyRGgtU

Please help me
-Niixie

EDIT:
The bug came for 1-2 days ago. no idea why, it just poped up. and then i made a folder only for that server.
Reply
#2

Make sure there is a folder called 'Server' in your scriptfiles folder and inside the Server folder there needs to be a folder called 'Users'
Reply
#3

Quote:
Originally Posted by dice7
Make sure there is a folder called 'Server' in your scriptfiles folder and inside the Server folder there needs to be a folder called 'Users'
If It didn't exist, server would crash.
Reply
#4

Quote:
Originally Posted by mavtias
Quote:
Originally Posted by dice7
Make sure there is a folder called 'Server' in your scriptfiles folder and inside the Server folder there needs to be a folder called 'Users'
If It didn't exist, server would crash.
No it wouldn't, test before doing false statements
Reply
#5

im not very good scripter but try this
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/mRegistration/%s.ini",name);
if(fexist(file))
insted of
pawn Код:
format(file, sizeof(file), "Server/Users/%s.ini", PlayerName);
 if(fexist(file))
THATS UNDER CMD:login(playerid, params[])
AND
CMD:register(playerid, params[])
Reply
#6

Thanks for your replys, but i have to say that i've checked a hell lot of times if the folders were at their place. Its the user file that doesnt get created.

And park4bmx, i have a func. that gets a players name. So that would be a waste of lines when i could use PlayerName which means the players name.

What else can be wrong?
Reply
#7

Try these

pawn Код:
CMD:register(playerid, params[])
{
    if(dini_Int(ServerFile, "Locked") == 0)
    {
        new Pass[256], IP[16];
        GetPlayerIp(playerid, IP, sizeof(IP));
       
        if(sscanf(params, "s", Pass))return SendClientMessage(playerid, COLOR_GREENLIGHT, "[Usage]: /register [Password] (maximum: 24 symbols)");
        else if(strlen(Pass) > 24) return ERRORMSG(playerid, "[Server]: Your password is too long.");
        else if(IsLogged[playerid]==1)return SendClientMessage(playerid, COLOR_RED, "[Server]: You're already logged in!");
        else
        {
            format(file, sizeof(file), "Server/Users/%s.ini", PlayerName);
            if(fexist(file)) return ERRORMSG(playerid, "[Server]: The username is already found in the database, use /login");
               
            dini_Create(file);
            dini_IntSet(file, "Password", udb_hash(Pass));
            dini_Set(file, "IP", IP);
            dini_IntSet(file, "AccountID", dini_Int(ServerFile, "Accounts"));
            dini_IntSet(file, "AdminLevel", 0);
            dini_IntSet(file, "Registered", 0);
            dini_IntSet(file, "Muted", 0);
            dini_IntSet(file, "Level", GetPlayerScore(playerid));
            dini_IntSet(file, "Money", GetPlayerMoney(playerid));
            dini_IntSet(file, "Exp", 0);
            dini_IntSet(file, "Skin", 23);
            dini_IntSet(file, "Age", 0);
            dini_Set(file, "Born", "Unknown");
            dini_Set(file, "dStyle", "Unknown");
            dini_Set(file, "RaceSpecial", "Unknown");
            dini_Set(file, "FavCar", "Unknown");
            dini_IntSet(file, "posX", 0);
            dini_IntSet(file, "posY", 0);
            dini_IntSet(file, "posZ", 0);
            dini_IntSet(file, "Interior", 0);
            dini_IntSet(file, "World", 0);
            dini_IntSet(file, "Testcorrect", 0);
            dini_IntSet(file, "Testincorrect", 0);
            dini_IntSet(file, "Banned", 0);
           
            new accounts = dini_Int(ServerFile, "Accounts");
            dini_IntSet(ServerFile, "Accounts", accounts + 1);

            TextDrawHideForPlayer(playerid, Registerscreen0[playerid]);
            TextDrawHideForPlayer(playerid, Registerscreen1[playerid]);
            TextDrawHideForPlayer(playerid, Registerscreen2[playerid]);
            TextDrawHideForPlayer(playerid, Registerscreen3[playerid]);
            TextDrawHideForPlayer(playerid, Registerscreen4[playerid]);
            TextDrawHideForPlayer(playerid, Registerscreen5[playerid]);
            TextDrawHideForPlayer(playerid, Registerscreen6[playerid]);
            TextDrawHideForPlayer(playerid, Registerscreen7[playerid]);
            TextDrawHideForPlayer(playerid, Registerscreen8[playerid]);
               
            TextDrawShowForPlayer(playerid, Loginscreen0[playerid]);
            TextDrawShowForPlayer(playerid, Loginscreen1[playerid]);
            TextDrawShowForPlayer(playerid, Loginscreen2[playerid]);
            TextDrawShowForPlayer(playerid, Loginscreen3[playerid]);
            TextDrawShowForPlayer(playerid, Loginscreen4[playerid]);
            TextDrawShowForPlayer(playerid, Loginscreen5[playerid]);
            TextDrawShowForPlayer(playerid, Loginscreen6[playerid]);
            TextDrawShowForPlayer(playerid, Loginscreen7[playerid]);
            TextDrawShowForPlayer(playerid, Loginscreen8[playerid]);

        }
    }
    else
    {
      ERRORMSG(playerid, "[Server]: All the commands will be locked until you have typed the server password!");
    }
    return 1;
}

CMD:login(playerid, params[])
{
    if(dini_Int(ServerFile, "Locked") == 0)
    {
        if (strlen(params) > 24) return ERRORMSG(playerid, "[Server]: The password is you typed is too long, try again");
        else if(IsLogged[playerid] == 1) return ERRORMSG(playerid, "[Server]: You're already logged in!");
        else
        {
            format(file, sizeof(file), "Server/Users/%s.ini", PlayerName);
            if(fexist(file))
            {
            new FilePass[256];
                FilePass = dini_Get(file, "Password");
                if(udb_hash(params) == udb_hash(FilePass)) // Change to != if its all wrong on login
                {
                    LoadStats(playerid);
                }
                else
                {
                    ERRORMSG(playerid, "[Server]: Login failed, try again");
                }
            }
            else
            {
                SENDMSG(playerid, COLOR_GREENLIGHT, "[Server]: This username is not found in the database, please use /register");
            }
        }
    }
    else
    {
      ERRORMSG(playerid, "[Server]: All the commands will be locked until you have typed the server password!");
    }
    return 1;
}
Reply
#8

whats the diff.?
Reply
#9

Bump*
Reply
#10

if(fexist(file))

thats not the right function to check for dini files...
if(Dini_Exists(file))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)