mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-06-30 16:21:48 +00:00
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:
46
actions_on_button_press/suicide_on_button_press.gsc
Normal file
46
actions_on_button_press/suicide_on_button_press.gsc
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user