Is there something wrong with this scripting?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <dbi>
#include <sqlx>
new Sql:dbc
new Result:result
new playername[20][20]
public plugin_init()
{
register_plugin("Test", "BETA", "fmc")
sql_init()
}
public client_authorized(id)
{
if(is_user_bot( id ) || is_user_hltv( id ))
return PLUGIN_CONTINUE
if (dbc == SQL_FAILED)
{
return PLUGIN_HANDLED;
}
new authid[32]
get_user_authid(id,authid,31)
result = dbi_query(dbc,"SELECT * FROM Players WHERE steamid = '%s'",authid)
if (result == RESULT_NONE || result == RESULT_FAILED)
{
return PLUGIN_CONTINUE
}
else
{
dbi_nextrow(result)
dbi_result(result,"name",playername[id],15)
}
dbi_free_result(result)
return PLUGIN_HANDLED;
}
public sql_init()
{
new error[256]
dbc = dbi_connect("host","user","pass","database" , error , 255)
if (dbc == SQL_FAILED)
{
server_print("[SQL] %s", error)
}
}
public plugin_end()
dbi_close(dbc);
public client_putinserver (id)
client_cmd( id , "name ^"%s^"",playername[id])
Sorry for my english
__________________