OnPlayerLogin help.
#1

I get this, mabye someone can help me, thanks in advance!

Код:
C:\Users\Nate\Desktop\SAMP-RP\gamemodes\R-RP.pwn(8805) : error 025: function heading differs from prototype
PHP код:
}
stock OnPlayerLogin(playeridpassword[])
{
    new 
        
sqlQuery[300], 
        
password2 num_hash(password)
    ;
    
format(sqlQuerysizeof(sqlQuery), "SELECT * FROM samp_users WHERE `Username`='%s' AND `Password`='%d'"GPN(playerid), password2);
    
mysql_query(sqlQueryTHREAD_LOGINplayerid);
    return 
1;

Reply
#2

I bet it's about function heading that is different (differs) from its prototype. Probably in line 8805 as it says.
Reply
#3

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
I bet it's about function heading that is different (differs) from its prototype. Probably in line 8805 as it says.
This line is 8805
Код:
stock OnPlayerLogin(playerid, password[])
Reply
#4

https://www.******.com/search?q=func...m=122&ie=UTF-8
Reply
#5

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
Cannot find something that's helps me.
Reply
#6

Show me the way you call your OnPlayerLogin stock, where do you call that function from exactly.
Reply
#7

Not everyone understands the error codes.

Show us the line where you use the function.
Reply
#8

Hashed passwords are integers, not strings. Therefore, password[] = string. Use this:

Код:
stock OnPlayerLogin(playerid, password) 
{ 
    new  
        sqlQuery[300],  
        password2 = num_hash(password) 
    ; 
    format(sqlQuery, sizeof(sqlQuery), "SELECT * FROM samp_users WHERE `Username`='%s' AND `Password`='%d'", GPN(playerid), password2); 
    mysql_query(sqlQuery, THREAD_LOGIN, playerid); 
    return 1; 
}
I removed the " [] " at " stock OnPlayerLogin(playerid, password) "
Reply
#9

Quote:
Originally Posted by Lucky13
Посмотреть сообщение
Hashed passwords are integers. Use this:

Код:
stock OnPlayerLogin(playerid, password) 
{ 
    new  
        sqlQuery[300],  
        password2 = num_hash(password) 
    ; 
    format(sqlQuery, sizeof(sqlQuery), "SELECT * FROM samp_users WHERE `Username`='%s' AND `Password`='%d'", GPN(playerid), password2); 
    mysql_query(sqlQuery, THREAD_LOGIN, playerid); 
    return 1; 
}
I removed the " [] " at " password
You must be mad by removing array definition from that. So you want user to enter password with characters and numbers and save just numbers? In this case, just LOAD numbers? Instead of that make password2 variable to be a string array holding certain amount of characters, num_hash is probably around 64 characters if I remember this well, been years ago since I have used this one, maybe more. He should know it, since it's his code.
Reply
#10

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
You must be mad by removing array definition from that. So you want user to enter password with characters and numbers and save just numbers? In this case, just LOAD numbers? Instead of that make password2 variable to be a string array holding certain amount of characters, num_hash is probably around 64 characters if I remember this well, been years ago since I have used this one, maybe more. He should know it, since it's his code.
If he hashes the password BEFORE he calls OnPlayerLogin, it will work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)