Try this:
Couldn't think about a nice name for the natives so I used
([g/s]et_user_entity)
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Run throught entities"
#define VERSION "1.0"
#define AUTHOR "Xalus"
new bool:bCanGoThrought[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
// Register: Ham
RegisterHam(Ham_Touch, "player", "Ham_TouchPlayer")
}
public plugin_natives()
{
register_native("get_user_entity", "native_get")
register_native("set_user_entity", "native_set")
}
public native_get(iPlugin, iParams)
{
new id = get_param(1)
if(is_user_connected(id))
return int:bCanGoThrought[id]
return 0
}
public native_set(iPlugin, iParams)
{
new id = get_param(1)
if(is_user_connected(id))
return (bCanGoThrought[id] = bool:get_param(2))
return 0
}
public Ham_TouchPlayer(id, entity)
{
if(is_user_alive(id) && pev_valid(entity) && !is_user_connected(entity) && bCanGoThrought[id])
{
set_pev(entity, pev_owner, id)
}
}