Raised This Month: $ Target: $400
 0% 

Store a value on an entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LagParty
Junior Member
Join Date: Jul 2008
Old 12-22-2008 , 00:10   Store a value on an entity
Reply With Quote #1

wich pev_ can i "safely" use for storing a userid? (for example)

i've tried with pev_euser1 and works good, but i dont know whats the real use for that value. The entity that im using represents a dead player.

Thanks.
LagParty is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-22-2008 , 00:16   Re: Store a value on an entity
Reply With Quote #2

Use your own storage for that. You don't know how the engine may use those, so I prefer not to mess with them. Any specific reason you can't use a global array or something like that?
__________________

Community / No support through PM
danielkza is offline
LagParty
Junior Member
Join Date: Jul 2008
Old 12-22-2008 , 00:36   Re: Store a value on an entity
Reply With Quote #3

i have an entity for every player (32) so, to find the player for an entity i would need to loop over and over the 32 player array, VERY frequently. I just wanted to know if there was a faster way. (i like to optimize my plugins )
LagParty is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-22-2008 , 00:57   Re: Store a value on an entity
Reply With Quote #4

Quote:
Originally Posted by LagParty View Post
i have an entity for every player (32) so, to find the player for an entity i would need to loop over and over the 32 player array, VERY frequently. I just wanted to know if there was a faster way. (i like to optimize my plugins )
Since you created the entity, just use pev_owner. We know what it serves for, and this use fits it perfectly.
__________________

Community / No support through PM

Last edited by danielkza; 12-22-2008 at 01:43. Reason: typo
danielkza is offline
LagParty
Junior Member
Join Date: Jul 2008
Old 12-22-2008 , 01:35   Re: Store a value on an entity
Reply With Quote #5

Ok thanks. If the fourm didnt had a block your karma would be over the limit
LagParty 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 09:08.


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