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
This commit is contained in:
Resxt
2022-02-27 00:08:01 +01:00
parent db886926ad
commit f5c649124e
4 changed files with 209 additions and 109 deletions

View File

@ -0,0 +1,46 @@
#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);
}