diff options
author | rafa_99 <raroma09@gmail.com> | 2022-02-03 04:14:48 +0000 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2022-02-03 04:14:48 +0000 |
commit | d71d5b612366513c44ecaa3701c0e9693e78502d (patch) | |
tree | 03567cc1249f893ae3bde73fa1c21175969fbd0a /mods/mysterybox/customBoxPrice.gsc | |
parent | e3b073b85ff0923b6fee3b95e3d8b5898b4a30c2 (diff) |
Updated Mods
Diffstat (limited to 'mods/mysterybox/customBoxPrice.gsc')
-rwxr-xr-x | mods/mysterybox/customBoxPrice.gsc | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mods/mysterybox/customBoxPrice.gsc b/mods/mysterybox/customBoxPrice.gsc new file mode 100755 index 0000000..8749f52 --- /dev/null +++ b/mods/mysterybox/customBoxPrice.gsc @@ -0,0 +1,44 @@ +#include common_scripts/utility;
+#include maps/mp/zombies/_zm_utility;
+
+init()
+{
+ level thread onPlayerConnect();
+}
+
+onPlayerConnect()
+{
+ while(1)
+ {
+ level waittill("connected", player);
+ player thread onPlayerSpawned();
+ }
+}
+
+onPlayerSpawned()
+{
+ self endon("disconnect");
+ level endon("game_ended");
+ while(1)
+ {
+ self waittill("spawned_player");
+
+ // Waits for the black preload screen to pass so it can load the mods
+ flag_wait( "initial_blackscreen_passed" );
+
+ // Mod that sets the box price
+ setBoxPrice(l, 950);
+ }
+}
+
+/*
+ * Function that sets a custom box price
+ */
+setBoxPrice(l, price)
+{
+ for (i = 0; i < l.chests.size; i++)
+ {
+ level.chests[ i ].zombie_cost = price;
+ level.chests[ i ].old_cost = price;
+ }
+}
|