13.10.2013, 12:04
Okay I fixed two of the errors I was getting by creating a stock (saw a similar post to mine):
Still getting the one error though:
Код:
#include <a_samp> #include <a_mysql> GetMoney(name[]) { mysql_connect("127.0.0.1", "root", "freshdatabase", ""); new Query[256]; format(Query, 256, "SELECT * FROM accounts WHERE username='%s'", name); mysql_query(Query); mysql_store_result(); new nMoneyAmount; while(mysql_fetch_row_format(Query,"|")) { mysql_fetch_field_row(nMoneyAmount, "Money"); // THIS IS LINE 15! } return nMoneyAmount; } public OnPlayerCommandText(playerid, cmdtext[]) { new string[48], pMoney; pMoney = GetMoney(pName(playerid)); if(!strcmp(cmdtext, "/mysqltest", true)) { format (string, sizeof(string), "%d", pMoney); SendClientMessage(playerid, 0xC2A2DAAA, string); } return 0; } public OnFilterScriptInit() { } stock pName(playerid) { new iName[MAX_PLAYER_NAME]; GetPlayerName(playerid, iName, sizeof(iName)); return iName; }
Код:
C:\Users\owner\Documents\server\Server\filterscripts\MYSQLTEST.pwn(15) : error 035: argument type mismatch (argument 1) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.