AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [engine] entity get/set edict (https://forums.alliedmods.net/showthread.php?t=196454)

striker07 09-21-2012 08:45

[engine] entity get/set edict
 
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_ownerid// set owner (id is the index of the player)
server_print("%i :  name: %s   is the owner of this bomb"idszName)
 
/*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(idEV_ENT_owner
new 
szName[35]
get_user_name(pownerszNamecharsmax(szName))
 
if( !
is_valid_ent(powner) )
   {
        
server_print("<<<<<<<<<DEBUG Get owner of the bombs is invalid: %i   %s,   the entity id is: %i "pownerszNameid )
 
        return 
PLUGIN_HANDLED
   


here is the problem, when retrieving the owner index of the entity id (id),
My server console shows this:
Spoiler

MyPc 09-21-2012 09:29

Re: [engine] entity get/set edict
 
new powner = entity_get_edict(ENTITY, EV_ENT_owner)

ConnorMcLeod 09-21-2012 11:23

Re: [engine] entity get/set edict
 
Show full code then.

striker07 09-21-2012 11:29

Re: [engine] entity get/set edict
 
Quote:

Originally Posted by MyPc (Post 1803332)
new powner = entity_get_edict(ENTITY, EV_ENT_owner)

nvm it was that, it needed to be this: new powner = entity_get_edict(bombs[id], EV_ENT_owner)


All times are GMT -4. The time now is 08:22.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.