home *** CD-ROM | disk | FTP | other *** search
- /*
- TeamFortress 1.1 - 27/8/96
-
- Robin Walker, John Cook, Ian Caughley.
-
- Functions specific to the Multiskin section of TeamFortress.
- */
-
- // Prototypes
- void(float skinno) Multiskin_SetSkin;
- void() Multiskin_NextSkin;
- void() Multiskin_PrevSkin;
- void() Multiskin_DisplayName;
-
- //=========================================================================
- // Set the Skin of the self entity to skinno
- void(float skinno) Multiskin_SetSkin =
- {
- // If Classkin is on, prevent skin changes
- if (!(toggleflags & TFLAG_SKIN))
- return;
-
- if (skinno > MS_MAX_SKIN)
- {
- skinno = MS_MAX_SKIN;
- }
-
- self.skin = skinno;
- Multiskin_DisplayName();
- };
-
- //=========================================================================
- // Increment the skin of the self entity
- void() Multiskin_NextSkin =
- {
- // If Classkin is on, prevent skin changes
- if (!(toggleflags & TFLAG_SKIN))
- return;
-
- self.skin = self.skin + 1;
-
- if (self.skin > MS_MAX_SKIN)
- self.skin = 0;
-
- Multiskin_DisplayName();
- };
-
- //=========================================================================
- // Decrement the skin of the self entity
- void() Multiskin_PrevSkin =
- {
- // If Classkin is on, prevent skin changes
- if (!(toggleflags & TFLAG_SKIN))
- return;
-
- self.skin = self.skin - 1;
-
- if (self.skin < 0)
- self.skin = MS_MAX_SKIN;
-
- Multiskin_DisplayName();
- };
-
- //=========================================================================
- // Write a description of the self entity's current skin to the self entity
- void() Multiskin_DisplayName =
- {
- local string sn;
-
- if (self.classname != "player")
- return;
-
- // Display skin name
- sprint(self, "Skin no ");
- sn = ftos(self.skin);
- sprint(self, sn);
- sprint(self, ".\n");
- };