Forum

> > CS2D > Scripts > Change teams without deaths
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Change teams without deaths

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Change teams without deaths

cortz
Super User Off Offline

Zitieren
I'm working on a script that would randomize the teams of players if one side becomes over stacked.

I initially thought that switching players between teams on the startround_prespawn hook would prevent a death for players but that doesn't seem to be the case.

In a last desperate resort, I'm here to ask if there is any possible way to change a player's team without having them die?

alt Re: Change teams without deaths

Pagyra
User Off Offline

Zitieren
You can simply change the death score for upon team changes.
by setdeaths
Zitat
Categories
server

Parameters
player (1-32): id of a player
deaths (0-X): deaths

Info
Set the number of deaths of a player (as server only).


Something like this:
1
2
3
4
5
6
7
8
9
10
11
12
parse("mp_autoteambalance 0")

addhook("join","pj")
function pj(id)
	if player(id,"team")~=0 then
          if player(id,"health")>0 then
               pos={player(id,"x"),player(id,"y")}
               parse("setdeaths "..id.." "..player(id,"deaths")-1)
               parse("spawnplayer "..id.." "..pos[1].." "..pos[2])
          end
     end
end
2× editiert, zuletzt 23.05.14 06:46:05

alt Re: Change teams without deaths

Yates
Reviewer Off Offline

Zitieren
user VaiN hat geschrieben
taking away the death from the score won't fix their rank stats though, that will still be affected right?

Correct. Stat file update doesn't happen on leave, it happens on kill & die (Includes team change etc). This means if you want to make your own team changing system you'll have to make your own ranking system as well. Counting all the times someone has been forced to change team and saving that to use it to calculate the actual deaths of someone with the stats file.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht