I think you will just need to keep re-checking as I do not believe there are any events fired when flags are changed. It is not an expensive native so it's not the end of the world.
PHP Code:
static cell AMX_NATIVE_CALL get_user_flags(AMX *amx, cell *params) /* 2 param */
{
int index = params[1];
if (index < 0 || index > gpGlobals->maxClients)
{
LogError(amx, AMX_ERR_NATIVE, "Invalid player id %d", index);
return 0;
}
int id = params[2];
if (id < 0)
id = 0;
if (id > 31)
id = 31;
return GET_PLAYER_POINTER_I(index)->flags[id];
}
__________________