Code:
new Sql:dbc
new Result:result
// ...
public client_putinserver(id) {
set_task(1.0,"checkSteam",id)
return PLUGIN_HANDLED
}
public checkSteam(id)
{
new query[256],sqlid[46], authid[32]
get_user_authid(id, authid, 31)
format(query,255,"SELECT steamid, reason, time FROM tempbans")
result = dbi_query(dbc,query) //**PROBLEM HERE**
while(dbi_nextrow(result) > 0)
{
dbi_result(result, "steamid" , sqlid , 45)
if(equali(authid,sqlid)) {
new reason[101], var;
dbi_result(result, "reason" , reason , 100)
var = dbi_result(result, "time")
new name[32]
get_user_name(id,name,31)
client_print(0,print_chat,"[AMXX] %s (%s) is still banned for %i minutes",name,authid,var)
server_cmd("kick #%d ^"%s (%i minutes left in ban)^"",get_user_userid(id),reason,var)
return PLUGIN_HANDLED
}
}
dbi_free_result(result)
return PLUGIN_HANDLED
}
It suddenly stopped working today. Is this because there is only one row and it needs two or more to function?