Swapping between players Created 1 month ago2021-11-30 06:30:03 UTC by Petko Petko

Created 1 month ago2021-11-30 06:30:03 UTC by Petko Petko

Posted 1 month ago2021-11-30 06:30:03 UTC Post #346086
I need help with this, beacuse I havent been able to figure this out on my own.
This is for a mod im working on (A decay port to PC source code can be found here)
So the set up Ive got so far is this:
Each player when spawning gets assigned a custom m_decayIndex value (from 1 to 2, if its not decay its 0)
I need to figure out how to change both players positions, angles, health, weapons, ammo, etc, with eachother
I alredy have a command that changes the index, but I need it to change players completely.

Help would be appreciated.
Posted 1 month ago2021-12-20 22:52:58 UTC Post #346141
I thought about how to do this a while ago but never looked into it, and I don't know what the Decay mod did but I imagine you could decompile their .dll and see.
I'd try just swapping the pev of the two players and see how that goes.
Posted 1 month ago2021-12-21 11:50:40 UTC Post #346147
Swapping the "pev" of the 2 players doesnt work. The solution i used switched some things between players pev(s) (origin, angles, viewangles, etc), but not the entire thing. This solution has quite a few problems, the bot ignores triggers, floats in the air, and moves with a tram that it is not even standing on.
I think using SET_VIEW would be the best solution, but it doesnt work for some reason on players. (Makes the targeted players model invisible, but the players view is left unchanged)
Posted 1 month ago2021-12-24 04:42:32 UTC Post #346155
Hm, is it possible to swap the edict_t* of the players?
You must be logged in to post a response.