GetArmorType
From ZDoom Wiki
int GetArmorType (string armortype, int playernum)
Returns true if the player's armor type matches the first parameter.
Parameters
- armortype: The class name of an armor type. This must be either “None”, the name of a BasicArmorPickup or that of a BasicArmorBonus.
- playernum: Player number. This information can be obtained through PlayerNumber.
This function targets only players. It concerns only BasicArmor and therefore does not cover HexenArmor.
Return value
The return value is the number of armor points if the player wears the designated armor, 0 otherwise.
Examples
This script constantly informs the first player which kind of Doom armor he is wearing.
script 1 ENTER
{
while (1)
{
delay(35);
if (GetArmorType("None", 0))
HudMessage(s:"You are unarmored.";
HUDMSG_PLAIN, 1, CR_RED, 0.1, 0.9, 5.0);
else if (GetArmorType("ArmorBonus", 0))
HudMessage(s:"You are unarmored but have found armor bonuses";
HUDMSG_PLAIN, 1, CR_RED, 0.1, 0.9, 5.0);
else if (GetArmorType("GreenArmor", 0))
HudMessage(s:"You have a security armor";
HUDMSG_PLAIN, 1, CR_RED, 0.1, 0.9, 5.0);
else if (GetArmorType("BlueArmor", 0))
HudMessage(s:"You have a combat armor";
HUDMSG_PLAIN, 1, CR_RED, 0.1, 0.9, 5.0);
else if (GetArmorType("BlueArmorForMegasphere", 0))
HudMessage(s:"You have a megasphere";
HUDMSG_PLAIN, 1, CR_RED, 0.1, 0.9, 5.0);
else HudMessage(s:"What the hell are you wearing?";
HUDMSG_PLAIN, 1, CR_RED, 0.1, 0.9, 5.0);
}
}