13.10.2013, 08:01
If I understand you correctly, I think you need to do the following:
at the top of the filterscript you need to
then you would connect to the mysql server and access the database the same way the game mode accesses it
Let me know if you need anything here clarified.
at the top of the filterscript you need to
Код:
#include <a_mysql>
Код:
GetMoney(name[]) { mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS); new Query[256]; format(Query, 256, "SELECT * FROM playerdata WHERE username='%s'", name); mysql_query(Query); mysql_store_result(); new nMoneyAmount; while(mysql_fetch_row_format(Query,"|")) { mysql_fetch_field_row(nMoneyAmount, "money"); //nMoneyAmount will store the retrieved variable, in this case the players money, and "money" is the name of the row in the database } return nMoneyAmount; }