Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin
Archive › Old Forum Threads › Help › Scripting Help › save custom-setting to an weapon-entity
8 posts, 2 people · 956 views Thread Rating: ★★★★★
closedsave custom-setting to an weapon-entity
Started by ghzero on 03-23-2009, 04:14 PM
ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
03-23-2009, 04:14 PM #1

hello,rnrnmy idea: to do remember an weapon that was damaged by underwater-moving of player.rnrnhow can I save an custom-setting to an existing weapon-entity ?! (to check the entity after wpn_pickup for it)rnand do you know if that can result sideeffects to dod?!

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-23-2009, 04:24 PM #2

you could probably get the weapon entity and save a value to like one of the pev_iuser# valuesnnsimilar to how dod_weaponjam saves whether a weapon is jammed even after a player drops it and another player picks it up

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
03-23-2009, 04:37 PM #3

allright, I'll take a look at that plugin to learn more about it..rnrndo you know if it can abuse the dod engine?! (if I save something like that to an entity)

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-23-2009, 04:39 PM #4

well i havent noticed any issues when using the iuser (or fuser etc...) parts of weapon entitiesnnni dont remember completely, but i think one of them is used for the players stamina for player entities, but im yet to see them used by anything for weapons

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
03-23-2009, 04:48 PM #5

allright in your plugin you use some offsets to save/load your flags.rnrncan I give an new offset to an weapon-entity or have(must) I use an existing and have to look that it dont abuse other things?

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-23-2009, 05:23 PM #6

every entity has a set amount of these..nnfor integers: (these im pretty sure dod may use ALL of them for player entities, dont remember exactly what is stored in each one tho... and as far as non-player entities go, im not sure but have not seen them used anywhere up to this point)npev_iuser1npev_iuser2 (for player entities this stores who is spectating them i believe)npev_iuser3npev_iuser4nnfor float values:npev_fuser1npev_fuser2npev_fuser3npev_fuser4nnnot sure what these are used for:npev_euser1npev_euser2npev_euser3npev_euser4nnbelieve these are for storing vector arrays or whatever (such as origin[3])npev_vuser1npev_vuser2npev_vuser3npev_vuser4nnnnow if you wanted to use the iuser entvar fields and make it so it doesnt conflict with dod_weaponjam, you could use iuser1 & iuser2 (because the weapon jam uses iuser3 and iuser4 on weapon entities)nni guess it depends how many you plan on using, and if youre not running dod_weaponjam you could still use iuser3 and 4nnnkind of hard to explain i guess, hope im not making it more confusing then it needs to be :)

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
03-23-2009, 05:35 PM #7

allright unterstood - but what should I use if I what to use your dod_weaponjam too (only for 0 and 1 ) ?

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-23-2009, 06:03 PM #8

like if you wanted to jam the weapon?nnhmm i would think setting doing set_pev(weaponent,pev_iuser4,1) would do itnnnnnot sure if thats what you meant

Archive › Old Forum Threads › Help › Scripting Help › save custom-setting to an weapon-entity
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC