Raised This Month: $ Target: $400
 0% 

[engine] entity get/set edict


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 09-21-2012 , 08:45   [engine] entity get/set edict
Reply With Quote #1

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
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 09-21-2012 at 08:46.
striker07 is offline
MyPc
Senior Member
Join Date: Sep 2011
Old 09-21-2012 , 09:29   Re: [engine] entity get/set edict
Reply With Quote #2

new powner = entity_get_edict(ENTITY, EV_ENT_owner)

Last edited by MyPc; 09-21-2012 at 09:29.
MyPc is offline
Old 09-21-2012, 11:09
striker07
This message has been deleted by striker07.
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-21-2012 , 11:23   Re: [engine] entity get/set edict
Reply With Quote #3

Show full code then.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 09-21-2012 , 11:29   Re: [engine] entity get/set edict
Reply With Quote #4

Quote:
Originally Posted by MyPc View Post
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)
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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