18.07.2011, 14:59
(
Последний раз редактировалось MdeRooy; 18.07.2011 в 15:32.
)
I have a little problem, and i hope one of you can help me with it. I defined the MYSQL_CHECKFORACCOUNT as 1, so i can use a switch to process the query result in the OnMysqlQueryArray callback.
I get the error listed below on the line which contains the mysql_query_array. Why is this? What do i need to change?
EDIT: After some investigation, i discovered that the error is in {playerid}, but i seem unable to leave it out. I can't leave it out either, because i need the playerid to handle the request properly!
I get the error listed below on the line which contains the mysql_query_array. Why is this? What do i need to change?
Код:
#define MYSQL_CHECKFORACCOUNT 1
Код:
CheckForAccount(playerid) { // --------------------------------------------------------------------------------- // New SQL style account checker! // --------------------------------------------------------------------------------- new query[128], pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(query, sizeof(query), "SELECT * FROM `users` WHERE `username`='%s'", pname); mysql_query_array(query, MYSQL_CHECKFORACCOUNT, {playerid}, server); }
Код:
tcrpg3.pwn(317) : error 008: must be a constant expression; assumed zero