The get_user_flags() works fine. I tested with log_amx() and it prints the message. The problem is the read_flags().
Tried the code:
PHP Code:
#include <amxmodx>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new const FreeFlags[ ] = { ADMIN_IMMUNITY, ADMIN_RESERVATION, ADMIN_CHAT }
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public client_putinserver(id)
{
new szConnectedName[32]
get_user_name(id, szConnectedName, charsmax(szConnectedName))
if(~get_user_flags(id) & ADMIN_LEVEL_H)
{
log_amx("Player %s(ID: %d) has connected on the server. He hasn't 'qt' flags, giving those...", szConnectedName, id)
new iFlags
for(new i; i < sizeof FreeFlags; i ++ )
{
iFlags = (iFlags | FreeFlags[i])
set_user_flags(id, iFlags)
}
}
else
{
log_amx("Player %s(ID: %d) has connected on the server. He has 'qt' flags.", szConnectedName, id)
server_print("Voce ja tem o acesso 't'")
}
}
Nothing was writed at the users.ini
__________________