Plutonium-IW5-Scripts/actions_on_button_press/suicide_on_button_press.gsc
Resxt f5c649124e actions_on_button_press 1.1
- Splitted the old script into 2 different scripts
- Fixed camera_thirdPerson changing for all players when a player presses the button by turning it into a vote instead
2022-02-27 00:08:01 +01:00

46 lines
776 B
Plaintext

#include maps\mp\gametypes\_hud_util;
Init()
{
level.suicide_button = "+actionslot 7";
DisplayButtonsText();
level thread OnPlayerConnected();
}
OnPlayerConnected()
{
for(;;)
{
level waittill("connected", player);
player thread OnSuicideButtonPressed(level.suicide_button);
}
}
OnSuicideButtonPressed(button)
{
self endon("disconnect");
level endon("game_ended");
self notifyOnPlayerCommand("suicide_button", button);
while(1)
{
self waittill("suicide_button");
self Suicide();
}
}
DisplayButtonsText()
{
suicide_text = level createServerFontString( "Objective", 0.65 );
suicide_text setPoint( "RIGHT", "RIGHT", -4, -227.5 );
suicide_text setText("^1Press [{" + level.suicide_button + "}] to suicide");
}
Debug(text)
{
print(text);
}