I can't seem to get this right and i have no idea what i'm doing wrong here, this is how i coded the
owner of a entity.
I debugged this using server_print
entity_set_edict:
PHP Code:
entity_set_edict(bombs[i], EV_ENT_owner, id) // set owner (id is the index of the player)
server_print("%i : name: %s is the owner of this bomb", id, szName)
/*Debug sais the correct id is set as the owner of the entity: 1 : name: Sky-High .:}O$G{:. is the owner of this bomb
no problems here.*/
entity_get_edict:
PHP Code:
new powner = entity_get_edict(id, EV_ENT_owner)
new szName[35]
get_user_name(powner, szName, charsmax(szName))
if( !is_valid_ent(powner) )
{
server_print("<<<<<<<<<DEBUG Get owner of the bombs is invalid: %i %s, the entity id is: %i ", powner, szName, id )
return PLUGIN_HANDLED
}
here is the problem, when retrieving the owner index of the entity id (id),
My server console shows this:
__________________