AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Can I store information in player entity? (https://forums.alliedmods.net/showthread.php?t=338606)

damage220 07-16-2022 14:14

Can I store information in player entity?
 
Let's say I have plugin A which gives a weapon to a player. In plugin B I want to block plugin A from giving a weapon to a player in the first round. I wonder if there is some unused value in a player entity to store set of bits in? Perhaps something that is HL specific? The idea is to make set of plugins that works out of the box and the one that manages flags to enable/disable some features. I really do not want to use callfunc_* family functions or write plugin as a module. All I need is an unused integer or string value.

jimaway 07-16-2022 14:39

Re: Can I store information in player entity?
 
pev_*user* fields

EFFx 07-16-2022 14:45

Re: Can I store information in player entity?
 
In my Realistic Bullet Physics there are a lot of examples and a LOT informations using what Jimaway said. Not only pev_iuser*, but pev_euser*, and also pev_fuser* (for floats). They are so helpful, definitely will help you.

damage220 07-16-2022 15:05

Re: Can I store information in player entity?
 
Perfect. That is definitely what I need. Thank you, guys.

XSlayer 07-25-2022 00:01

Re: Can I store information in player entity?
 
Quote:

Originally Posted by damage220 (Post 2783925)
Perfect. That is definitely what I need. Thank you, guys.

better use engine than fakemeta

PHP Code:

entity_set_intClientEV_INT_
                                 EV_INT_iuser1
,
                            
EV_INT_iuser2,
                            
EV_INT_iuser3,
                            
EV_INT_iuser4,
entity_set_floatClientEV_FL_
                                   EV_FL_fuser1
,
                            
EV_FL_fuser2,
                            
EV_FL_fuser3,
                            
EV_FL_fuser4,
entity_set_vectorClientEV_FL_
                                     EV_VEC_vuser1
,
                                     
EV_VEC_vuser2,
                                 
EV_VEC_vuser3,
                                 
EV_VEC_vuser4


XSlayer 07-25-2022 00:55

Re: Can I store information in player entity?
 
Quote:

Originally Posted by XSlayer (Post 2784703)
better use engine than fakemeta

PHP Code:

entity_set_intClientEV_INT_
                                 EV_INT_iuser1
,
                            
EV_INT_iuser2,
                            
EV_INT_iuser3,
                            
EV_INT_iuser4,
entity_set_floatClientEV_FL_
                                   EV_FL_fuser1
,
                            
EV_FL_fuser2,
                            
EV_FL_fuser3,
                            
EV_FL_fuser4,
entity_set_vectorClientEV_VEC_
                                     EV_VEC_vuser1
,
                                     
EV_VEC_vuser2,
                                 
EV_VEC_vuser3,
                                 
EV_VEC_vuser4



wilian159 07-25-2022 14:34

Re: Can I store information in player entity?
 
none is better than the other

XSlayer 07-25-2022 20:51

Re: Can I store information in player entity?
 
Quote:

Originally Posted by wilian159 (Post 2784797)
none is better than the other

nope, engine>>>>>fakemeta

damage220 07-25-2022 21:09

Re: Can I store information in player entity?
 
Quote:

Originally Posted by XSlayer (Post 2784836)
nope, engine>>>>>fakemeta

It is good to explain why you think so.

Bugsy 07-25-2022 22:08

Re: Can I store information in player entity?
 
pev() is not better or worse than entity_get_int().

If my plugin primarily uses engine natives then I'll use the engine variant, similar logic if my plugin is heavy on fakemeta natives.


All times are GMT -4. The time now is 15:37.

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