AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Store a value on an entity (https://forums.alliedmods.net/showthread.php?t=82367)

LagParty 12-22-2008 00:10

Store a value on an entity
 
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.

danielkza 12-22-2008 00:16

Re: Store a value on an entity
 
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?

LagParty 12-22-2008 00:36

Re: Store a value on an entity
 
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 :P)

danielkza 12-22-2008 00:57

Re: Store a value on an entity
 
Quote:

Originally Posted by LagParty (Post 731241)
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 :P)

Since you created the entity, just use pev_owner. We know what it serves for, and this use fits it perfectly.

LagParty 12-22-2008 01:35

Re: Store a value on an entity
 
Ok thanks. If the fourm didnt had a block your karma would be over the limit :D


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

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