OnPlayerLogin Stops working. (Not MySQL)
#1

SOLVED

SOLUTION:

Turns out one of my includes included a y_users.ini.. The y_users.ini had it's own forward on "OnPlayerLogin":
pawn Код:
OnPlayerLogin(playerid, yid);
All I did was replace the "OnPlayerLogin" in my gamemode script with "OnPlayerLogIn" and it worked. I had a feeling there was another one somewhere, just didn't know where.
Hiya, anyone have an idea why my OnPlayerLogin stopped working? My OnPlayerRegister works fine... Idk what's wrong..

================================================== ======================
Errors:
pawn Код:
(267) : error 025: function heading differs from prototype
(6272) : error 035: argument type mismatch (argument 2)
(6328) : error 035: argument type mismatch (argument 2)
(19354) : error 025: function heading differs from prototype
(Line: 267)
pawn Код:
forward OnPlayerLogin(playerid,password[]);
(Line: 6272)
pawn Код:
OnPlayerLogin(playerid,tmppass);
(Line: 632
pawn Код:
OnPlayerLogin(playerid,tmppass);
(Line: 19354)
pawn Код:
public OnPlayerLogin(playerid,password[])
Everything seems fine.. Idk what's wrong..
Reply
#2

Change tmppass to tmppass[]. Without the brackets you are declaring it as an integer, while in your forward it is a string.

Edit: just make sure tmppass is a string where you created it.
Reply
#3

Quote:
Originally Posted by zDevon
Посмотреть сообщение
Change tmppass to tmppass[]. Without the brackets you are declaring it as an integer, while in your forward it is a string.

Edit: just make sure tmppass is a string where you created it.
No, you are 100% wrong.

Make sure that tmppass is declared as a string with a size, and isn't empty.
Reply
#4

Quote:
Originally Posted by Schurman
Посмотреть сообщение
No, you are 100% wrong.

Make sure that tmppass is declared as a string with a size, and isn't empty.
Wrong? You said the exact same thing as me.
Reply
#5

Quote:
Originally Posted by zDevon
Посмотреть сообщение
Wrong? You said the exact same thing as me.
No, I did not. You told him to rename tmppass to tmppass[], which is NOT what I said.
Think, for a minute. When he uses the tmppass parameter, he is INVOKING the method, not declaring the method.

Do not do this, the compiler would throw invalid syntax errors.
Reply
#6

Quote:
Originally Posted by Schurman
Посмотреть сообщение
No, you are 100% wrong.

Make sure that tmppass is declared as a string with a size, and isn't empty.
It's not empty.
pawn Код:
new tmppass[64]; // Here it is :p This code looking good?
new playername[MAX_PLAYER_NAME];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
GetPlayerName(playerid, playername, sizeof(playername));
    if(strlen(playername) == 3)
    {
        if(strcmp(playername, "InActive", true) == 0)
        {
            return 0;
        }
        else
        {
                SendClientMessage(playerid, COLOR_LIGHTRED, "Sorry, that name is too short, please change it.");
                Kick(playerid);
            return 1;
        }
    }
         Encrypt(tmppass);
         OnPlayerLogin(playerid,tmppass);
    }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You chose to leave the server.");
            Kick(playerid);
        }
    }
That's what the main part of it looks like.
Reply
#7

Your indentation and the code given is confusing. It looks like you have an extra closing bracket between your calling of OnPlayerLogin, and else {
Reply
#8

Sorry, I tried to edit it to make it more legitimate... The code is much more organized in Pawno than in this thread.

Just before you posted that, I was thinking to myself "Maybe I have 1 extra or missing bracket". I went ahead and removed that one and got other errors. That tells me I DO have an extra/missing bracket lying around somewhere, the code is massive, but I gotta do what I gotta do or else this code will never compile successfully again .-.

Do you have any way I can reach you via. IM while I search for this extra/missing bracket? Any way you can assist me or any method you know how to find them easily?
Reply
#9

Quote:
Originally Posted by Schurman
Посмотреть сообщение
No, I did not. You told him to rename tmppass to tmppass[], which is NOT what I said.
Think, for a minute. When he uses the tmppass parameter, he is INVOKING the method, not declaring the method.

Do not do this, the compiler would throw invalid syntax errors.
You missed my edit I see. I corrected myself before you even posted.
Reply
#10

Just wanted to notify that I've edited my post.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)