Hello guys.
I have problem with my script.
Source:
Code:
#include <amxmodx>
#include <amxmisc>
#include <dbi>
#define PLUGIN "plugin"
#define VERSION "1.0"
#define AUTHOR "By conrad"
new Sql:dbc;
new Result:res;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_dictionary("csbank.txt")
register_clcmd("say /money", "saymoney", 0, "- displays hoe much money I have ")
// Add your code here...
}
public sql_init()
{
dbc = dbi_connect("localhost", "login", "password", "db")
if (dbc == SQL_FAILED)
{
server_print("[AMXX] %L", LANG_SERVER, "SQL_SERVER_DOWN")
}
else
{
server_print("[AMXX] %L", LANG_SERVER, "SQL_SERVER_UP")
}
}
public saymoney(id)
{
new szAuthid[32], szName[32], szMoney[32];
get_user_authid( id, szAuthid, 31 );
get_user_name( id, szName, 31 );
res = dbi_query(dbc, "SELECT `money` FROM table where name='%s' ", szName);
while (dbi_nextrow(res) > 0)
{
dbi_result(res, "money", szMoney, 31)
}
client_print(0,print_chat, szMoney);
}
It doesn't return any result back. What is the problem?