summaryrefslogtreecommitdiff
path: root/mods/main.gsc
blob: daa4cd911334e083b978151e75cf7538f09d22bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#include common_scripts/utility;
#include maps/mp/gametypes_zm/_hud_util;
#include maps/mp/zombies/_zm;
#include maps/mp/zombies/_zm_utility;
#include maps/mp/zombies/_zm_perks;
#include maps/mp/zombies/_zm_afterlife;
#include maps/mp/zombies/_zm_weapons;

// Loads the mods once the player connects to the server
onConnectMods(p, l)
{
	/*
	 * General Mods
	 */

	/*
	 * Player is invincible
	 */
	// godMode(p);

	/*
	 * Infinte ammo
	 */
	// thread unlimitedAmmo(p);

	/*
	 * Player initial points
	 *
	 * Customizable parameters:
	 * points - Number of points the player will start the game (ex: 500)
	 */
	// setPlayerPoints(p, 500);

	/*
	 * Custom Mystery Box price
	 *
	 * Customizable parameters:
	 * price - Ammount of points required to hit the box (ex: 950)
	 */
	// setBoxPrice(l, 950);
	
	/*
	 * Custom alive zombies limit
	 *
	 * Customizable parameters:
	 * limit - Ammount of zombies alive at the same time (ex: 24)
	 */
	// setZombieLimit(l, 24)

	/*
	 * Custom buyable perk limit
	 *
	 * Customizable parameters:
	 * numberOfPerks - Ammount of perks the player is allowed to purchase (ex: 9)
	 */
	// setPerkLimit(l, 9);

	/*
	 * Gives all the map available perks to the player
	 */
	// thread perkaholic(p, l);
	
	/*
	 * Enables night mode in all maps
	 *
	 * Visual Bug:
	 * In MotD, while in afterlife, sparks are invisible when shot
	 */
	// thread nightmode(p, l);
	
	/*
	 */

	/*
	 * MotD Mods
	 */

	/*
	 * Custom number of afterlifes
	 *
	 * Customizable parameters:
	 * lifes - Ammount of lifes available in afterlife (ex: 9)
	 *
	 * Visual Bug:
	 * If lifes parameter above 3, the in-game after-life counter wont't show the number.
	 */
	// catHas9Lifes(p, 9);

	/*
	 * Allows infinte afterlife timer
	 */
	// infinteAfterlifeTimer(p);

}

// Loads the mods once the player spawns inside the game
onSpawnMods(p, l)
{
	////////////////////////////////////////////////////////////////////////
	// Waits for the black preload screen to pass so it can load the mods //
	// DO NOT TOUCH THIS LINE BELOW!!                                     //
	flag_wait( "initial_blackscreen_passed" );                           //
	////////////////////////////////////////////////////////////////////////

	/*
	 * Gives the player a custom primary weapon
	 *
	 * Customizable parameters:
	 * weapon - Weapon name string available in the README.md file (ex: galil_zm (Galil))
	 * upgraded - Toggle for pack-a-punched given weapon (ex: true)
	 */
	// thread setPrimaryWeapon(p, l, "galil_zm", true);

	/*
	 * Gives the player a custom secondary weapon
	 *
	 * Customizable parameters:
	 * weapon - Weapon name string available in the README.md file (ex: ray_gun_zm (Ray Gun))
	 * upgraded - Toggle for pack-a-punched given weapon (ex: false)
	 */
	// thread setSecondaryWeapon(p, l, "ray_gun_zm", false);

	/*
	 * Gives joining players a secondary submachine gun, a couple of points and some perks
	 */
	// thread joinedBonus(p, l);

	/*
	 * Sets the player camera to the third person
	 *
	 * Customizable parameters:
	 * crosshair - Toggle crosshair for third person camera (ex: true)
	 */
	// playThirdPerson(p, true);

	/*
	 * Adds a zombie counter to the bottom of the screen
	 *
	 * Customizable parameters:
	 * x - X coordinates distance (ex: 0)
	 * y - Y coordinates distance (ex: 190)
	 */
	// thread zombieCounter(p, l, 0, 190);

	/*
	 * Adds a health counter to the bottom of the screen
	 *
	 * Customizable parameters:
	 * x - X coordinates distance (ex: 0)
	 * y - Y coordinates distance (ex: 190)
	 */
	// thread healthCounter(p, 0, 190);

	/*
	 * Adds a zombie and a health counter to the bottom of the screen
	 *
	 * Customizable parameters:
	 * x - X coordinates distance (ex: 100 & -100)
	 * y - Y coordinates distance (ex: 190)
	 */
	// thread healthCounter(p, -100, 190);
	// thread zombieCounter(p, l, 100, 190);
}

init()
{
	level thread onPlayerConnect();
}

onPlayerConnect()
{
	while(1)
	{
		level waittill("connected", player);
		thread onConnectMods(player, level);
		player thread onPlayerSpawned();
	}
}

onPlayerSpawned()
{
    self endon("disconnect");
    while(1)
    {
        self waittill("spawned_player");
        onSpawnMods(self, level);
    }
}