mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 12:42:54 +00:00
show_text_on_first_spawn 1.0
This commit is contained in:
parent
7fc8282c23
commit
1f5d5f9031
@ -36,3 +36,8 @@ This is a temporary solution to inactive bots or bots stuck in corners on custom
|
|||||||
This checks for bots kills and deaths every 30 seconds. If they didn't do any kill or didn't die in 30 seconds they're considered inactive/stuck and they're killed.
|
This checks for bots kills and deaths every 30 seconds. If they didn't do any kill or didn't die in 30 seconds they're considered inactive/stuck and they're killed.
|
||||||
Obviously a better way to do this would be checking for their positions or removing bad spawns on the map or creating waypoints for the map.
|
Obviously a better way to do this would be checking for their positions or removing bad spawns on the map or creating waypoints for the map.
|
||||||
This is just a quick temporary solution that works for me.
|
This is just a quick temporary solution that works for me.
|
||||||
|
|
||||||
|
## show_text_on_first_spawn.gsc
|
||||||
|
|
||||||
|
Show a text the first time a player spawns in every match.
|
||||||
|
This can be used to display a specific rule, a warning or just a message.
|
49
small_scripts/show_text_on_first_spawn.gsc
Normal file
49
small_scripts/show_text_on_first_spawn.gsc
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#include maps\mp\gametypes\_hud_util;
|
||||||
|
|
||||||
|
Init()
|
||||||
|
{
|
||||||
|
level thread OnPlayerConnected();
|
||||||
|
}
|
||||||
|
|
||||||
|
OnPlayerConnected()
|
||||||
|
{
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
level waittill("connected", player);
|
||||||
|
|
||||||
|
player thread OnPlayerSpawned();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OnPlayerSpawned()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
self waittill("spawned_player");
|
||||||
|
|
||||||
|
// Don't show first spawn text to bots
|
||||||
|
if (isDefined(self.pers["isBot"]))
|
||||||
|
{
|
||||||
|
if (self.pers["isBot"])
|
||||||
|
{
|
||||||
|
continue; // skip
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsDefined(self.pers["saw_first_spawn_message"]) || !self.pers["saw_first_spawn_message"])
|
||||||
|
{
|
||||||
|
self.pers["saw_first_spawn_message"] = true;
|
||||||
|
self ShowFirstSpawnMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ShowFirstSpawnMessage()
|
||||||
|
{
|
||||||
|
first_spawn_message = "^1Read the rules by typing !rules in the chat";
|
||||||
|
|
||||||
|
self IPrintLnBold(first_spawn_message);
|
||||||
|
wait 3;
|
||||||
|
self IPrintLnBold(first_spawn_message);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user