: error 025: function heading differs from prototype
#1

Код:
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 can't get my head around it, any ideas?
Reply
#2

Do you use YSI library? y_users have OnPlayerLogin defined. Rename it and the problem will be solved.
Reply
#3

I think it got fixed, yeah.

I got a saving problem though if you can help me out.
Код:
(29/9/2016) ErrorID: 1064
(29/9/2016) Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for t
(29/9/2016) Query: UPDATE samp_users SET `Password`='195625701', Level='2', Pos_x='2074.00', Pos_y='-1287.23', Pos_z='23.52', R
(29/9/2016) Callback: OnQueryFinish
Reply
#4

The logs are incomplete. Judging by OnQueryFinish, you use R5/R6/R6-2 version? If yes, either enable debug (mysql_debug), reproduce it and post mysql_log.txt file or post completed logs (you didn't copy the whole output or don't format correctly in OnQueryError callback, use printf (assuming you use format (+ print) and the size of the string is not enough)).
Reply
#5

Код:
[13:34:51]  

[13:34:51] ---------------------------

[13:34:51] MySQL Debugging activated (09/29/16)

[13:34:51] ---------------------------

[13:34:51]  

[13:34:51] >> mysql_connect( )

[13:34:51] CMySQLHandler::CMySQLHandler() - constructor called.

[13:34:51] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "samp-rp" | Username: "root" ...

[13:34:51] CMySQLHandler::Connect() - Connection was successful.

[13:34:51] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.

[13:34:51] >> mysql_ping( Connection handle: 1 )

[13:34:51] CMySQLHandler::Ping() - Connection is still alive.

[13:34:51] >> mysql_query( Connection handle: 1 )

[13:34:51] CMySQLHandler::Query(resultID) - Threaded query with id 10 started. (Extra ID: -1)

[13:34:51] CMySQLHandler::ProcessQueryThread(SELECT * FROM `samp_houses`) - Data is getting passed to OnQueryFinish() - (Threadsafe: Yes)

[13:34:51] >> mysql_query( Connection handle: 1 )

[13:34:51] CMySQLHandler::Query(resultID) - Threaded query with id 13 started. (Extra ID: -1)

[13:34:51] OnQueryFinish(10,"SELECT * FROM `samp_houses`") - Called.

[13:34:51] >> mysql_store_result( Connection handle: 1 )

[13:34:51] CMySQLHandler::StoreResult() - Result was stored.

[13:34:51] >> mysql_retrieve_row( Connection handle: 1 )

[13:34:51] >> mysql_free_result( Connection handle: 1 )

[13:34:51] CMySQLHandler::FreeResult() - Result was successfully free'd.

[13:34:51] CMySQLHandler::ProcessQueryThread(SELECT * FROM samp_papers) - Data is getting passed to OnQueryFinish() - (Threadsafe: Yes)

[13:34:51] OnQueryFinish(13,"SELECT * FROM samp_papers") - Called.

[13:34:51] >> mysql_store_result( Connection handle: 1 )

[13:34:51] CMySQLHandler::StoreResult() - Result was stored.

[13:34:51] >> mysql_retrieve_row( Connection handle: 1 )

[13:34:51] >> mysql_free_result( Connection handle: 1 )

[13:34:51] CMySQLHandler::FreeResult() - Result was successfully free'd.
Logs ^^
Reply
#6

You need to reproduce it first. Let it try to update and get the error syntax in console and then post the logs.
Reply
#7

What do you mean by reproduce?
Reply
#8

Starting the server and shutting it down doesn't help.

You get the syntax error in the UPDATE query so you need to connect and then disconnect so it will execute the faulty query and get the results we want in the mysql_log.txt file.
Reply
#9

Sorry, I just got back to SAMP scripting after having a year+ break, so I'm a bit rusty on this.

Connect what?
Reply
#10

You have to connect (join) to the server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)