Spawn Player like in opposite team
Hello. I looking for best algorythm for Spawn Player like in opposite team, ie:
Player playing for T, in next round he Spawns on CT base with CT player-model. For CTs he still enemy (T). How to do this? |
Re: Spawn Player like in opposite team
The tricky and easy way would be likely like hooking Spawn as pre, setting m_iTeam to CT, call ClientUserInfoChanged to update model, then in Spawn as post, set back team to T.
To lower possible issue of m_iTeam binge used by others plugin at this point, you can hook instead Ham_StartSneaking, which is called in Spawn, but right before the spawnpoint stuff. (You could also hook Spawn, and hooking StartSneaking insside, but it's unlikely a plugin would call this function, it does nothing). |
Re: Spawn Player like in opposite team
Quote:
|
Re: Spawn Player like in opposite team
Thanks for replies. Current code:
PHP Code:
http://5.firepic.org/5/thumbs/2015-0...56kvy2xko4.jpg Any way for change this team-info (in scoreboard, say, chat, etc.)? |
Re: Spawn Player like in opposite team
Then reset in Precache (player), it's called a bit after but before the TeamInfo message and such. Of course it's up to you to test and add relevant checks (Precache is likely to be called on player put in server).
|
Re: Spawn Player like in opposite team
See warcraft code of the spion item from shopmenu and just use that, its the same as you have requested.
P.s its easy , safe and fast. |
Re: Spawn Player like in opposite team
Quote:
Quote:
|
Re: Spawn Player like in opposite team
Ham_Precache with "player"
|
Re: Spawn Player like in opposite team
Arkshine, I found very offensively defect:
When Player use cl_minmodels 1, then Diversant Player looks like enemy :(. There is some way to fix it? Or I should totally change Diversant team to opposite and add some code like in CSDM FFA Mode ("Friend as Enemy")? |
All times are GMT -4. The time now is 02:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.