-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathl4d2_random_coop.sp
More file actions
542 lines (440 loc) · 19.9 KB
/
l4d2_random_coop.sp
File metadata and controls
542 lines (440 loc) · 19.9 KB
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#define USE_OLD_SPAWN true // use z_spawn_old ?
#define FALLEN_MODEL "models/infected/common_male_fallen_survivor.mdl"
/*
Make coop more RANDOM FUN.
Most of the work is now done by the mutationrandomcoop.nut script
This plugin should help with a few things that vscript can't do well
- spawn witches
- force spawns when the director has fallen asleep?
- spawn special hordes, such as fallen survivors (or other?)
*/
const TEAM_SPECTATOR = 1;
const TEAM_SURVIVOR = 2;
const TEAM_INFECTED = 3;
const LTIMER_ENABLED = 0;
const LTIMER_DISABLED = 1;
const COOP_DIFFICULTY_EASY = 1;
const COOP_DIFFICULTY_HARD = 2;
const ZC_SMOKER = 1;
const ZC_BOOMER = 2;
const ZC_HUNTER = 3;
const ZC_SPITTER = 4;
const ZC_JOCKEY = 5;
const ZC_CHARGER = 6;
const ZC_WITCH = 7;
const ZC_TANK = 8;
const ZC_NOTINFECTED = 9;
const ZC_TOTAL = 7;
const ENC_HUNTERS = 1;
const ENC_JOCKEYS = 2;
const ENC_CHARGESPIT = 3;
const ENC_SUPPORT = 4;
const ENC_BIGATTACK = 5;
const ENC_FALLEN = 6;
const ENC_WITCHES = 7;
const Float: SPAWN_VARY_MAX = 0.5; // how much variation between SI/witches spawns, maximum (min = 0.0)
new bool: g_bLogicTimerEntSet = false; // whether we can trust the logic timers
new g_iLogicTimerEntEncounter[3];
new g_iLogicTimerEntAmount[4];
new g_iRemainingFallen = 0; // how many fallen survivors to spawn
new g_iCurrentDifficulty = 0;
new Handle: g_hCvarDebug = INVALID_HANDLE;
new Handle: g_hCvarPathToEasyConfig = INVALID_HANDLE;
new Handle: g_hCvarPathToHardConfig = INVALID_HANDLE;
new Handle: g_hCvarFallenChance = INVALID_HANDLE;
public Plugin:myinfo =
{
name = "Randomize the Game - Coop Stuff",
author = "Tabun",
description = "Makes L4D2 more fun and harder in coop mode.",
version = "0.9.3",
url = "https://github.com/Tabbernaut/L4D2-Random"
}
public OnPluginStart()
{
// cvars
g_hCvarDebug = CreateConVar("rand_debug_coop", "2",
"Random debug mode (coop plugin). (0: only error reporting, -1: disable all reports, 1+: set debug report level)",
FCVAR_NONE, true, -1.0, true, 5.0);
g_hCvarPathToEasyConfig = CreateConVar("rand_coop_easy_path", "cfgogl/randomcoop/difficulty_easy.cfg",
"The path to the cfg file with the settings for easy mode",
FCVAR_NONE);
g_hCvarPathToHardConfig = CreateConVar("rand_coop_hard_path", "cfgogl/randomcoop/difficulty_hard.cfg",
"The path to the cfg file with the settings for hard mode",
FCVAR_NONE);
CreateConVar("rand_vscript_hunter_min", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_hunter_max", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_charger_min", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_charger_max", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_jockey_min", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_jockey_max", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_support_min", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_support_max", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_spawning_timeout", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_encounter_timeout", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_buildup", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_gracetime", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_gracetime_long", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_normal_enc_interval", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_normal_jockey_interval", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_chargespit_total", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_chargespit_dom", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_chargespit_charger", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_chargespit_spitter", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_bigattack_total", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_bigattack_dom", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_bigattack_boomer", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_bigattack_smoker", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_bigattack_spitter", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
CreateConVar("rand_vscript_bigattack_jockey", "0", "Vscript cvar for difficulty switching", FCVAR_NONE);
g_hCvarFallenChance = FindConVar("rand_fallen_chance");
RegConsoleCmd("sm_randcoop_diff", RandomDifficulty_Cmd, "Display or set the difficulty for random coop.");
// prepare weights
//PrepareChoicesEncounters();
// precache fallen
PrecacheModel(FALLEN_MODEL, true);
// start timer
CreateTimer(1.0, Timer_CheckLogicTimer, _, TIMER_REPEAT);
g_iCurrentDifficulty = COOP_DIFFICULTY_EASY;
ChangeDifficulty(g_iCurrentDifficulty);
}
public Action: Timer_CheckLogicTimer (Handle:timer)
{
if (
g_bLogicTimerEntSet
&& (g_iLogicTimerEntEncounter[0] == 0 || ! IsValidEntity(g_iLogicTimerEntEncounter[0]))
) {
g_bLogicTimerEntSet = false;
}
// find the timers
if (! g_bLogicTimerEntSet) {
// find entity
decl String: sName[24];
new ent = -1;
while ((ent = FindEntityByClassname(ent, "logic_timer")) != -1) {
GetEntPropString(ent, Prop_Data, "m_iName", sName, sizeof(sName));
if (StrEqual( sName, "random_coop_timer_a_1")) {
g_iLogicTimerEntEncounter[0] = ent;
} else if ( StrEqual(sName, "random_coop_timer_a_2")) {
g_iLogicTimerEntEncounter[1] = ent;
} else if ( StrEqual(sName, "random_coop_timer_a_4")) {
g_iLogicTimerEntEncounter[2] = ent;
} else if ( StrEqual(sName, "random_coop_timer_b_1")) {
g_iLogicTimerEntAmount[0] = ent;
} else if ( StrEqual(sName, "random_coop_timer_b_2")) {
g_iLogicTimerEntAmount[1] = ent;
} else if ( StrEqual(sName, "random_coop_timer_b_4")) {
g_iLogicTimerEntAmount[2] = ent;
} else if ( StrEqual(sName, "random_coop_timer_b_8")) {
g_iLogicTimerEntAmount[3] = ent;
}
}
if (g_iLogicTimerEntEncounter[0] != 0 && IsValidEntity( g_iLogicTimerEntEncounter[0])) {
PrintDebug( 0, "[rndcoop] Found timers: %i", g_iLogicTimerEntEncounter[0] );
g_bLogicTimerEntSet = true;
}
}
if (! g_bLogicTimerEntSet ) {
return Plugin_Continue;
}
// vscript is trying to tell us something if anything but 0
new iEncounterValue = (
((GetEntProp(g_iLogicTimerEntEncounter[0], Prop_Data, "m_iDisabled") == LTIMER_ENABLED) ? 1 : 0) * 1
) +
(
((GetEntProp(g_iLogicTimerEntEncounter[1], Prop_Data, "m_iDisabled" ) == LTIMER_ENABLED) ? 1 : 0) * 2
) +
(
((GetEntProp(g_iLogicTimerEntEncounter[2], Prop_Data, "m_iDisabled" ) == LTIMER_ENABLED) ? 1 : 0) * 4
);
if (iEncounterValue > 0) {
new iAmountValue = (
((GetEntProp( g_iLogicTimerEntAmount[0], Prop_Data, "m_iDisabled" ) == LTIMER_ENABLED) ? 1 : 0 ) * 1
) +
(
((GetEntProp( g_iLogicTimerEntAmount[1], Prop_Data, "m_iDisabled" ) == LTIMER_ENABLED) ? 1 : 0 ) * 2
) +
(
((GetEntProp( g_iLogicTimerEntAmount[2], Prop_Data, "m_iDisabled" ) == LTIMER_ENABLED) ? 1 : 0 ) * 4
) +
(
((GetEntProp( g_iLogicTimerEntAmount[3], Prop_Data, "m_iDisabled" ) == LTIMER_ENABLED) ? 1 : 0 ) * 8
);
if (iAmountValue > 0) {
PrintDebug( 0, "[rndcoop] Status of timer: %i (amount: %i)", iEncounterValue, iAmountValue );
switch (iEncounterValue) {
case ENC_HUNTERS: {
for (new i = 0; i < iAmountValue; i++) {
CreateTimer( GetRandomFloat( 0.0, SPAWN_VARY_MAX ), Timer_SpawnSomething, ZC_HUNTER, TIMER_FLAG_NO_MAPCHANGE );
}
}
case ENC_JOCKEYS: {
for (new i = 0; i < iAmountValue; i++) {
CreateTimer( GetRandomFloat( 0.0, SPAWN_VARY_MAX ), Timer_SpawnSomething, ZC_JOCKEY, TIMER_FLAG_NO_MAPCHANGE );
}
}
case ENC_CHARGESPIT: {
for (new i = 0; i < iAmountValue; i++) {
CreateTimer( GetRandomFloat( 0.0, SPAWN_VARY_MAX ), Timer_SpawnSomething, (GetRandomInt(0,2)) ? ZC_CHARGER : ZC_SPITTER, TIMER_FLAG_NO_MAPCHANGE );
}
}
case ENC_SUPPORT: {
for (new i = 0; i < iAmountValue; i++) {
CreateTimer( GetRandomFloat( 0.0, SPAWN_VARY_MAX ), Timer_SpawnSomething, (GetRandomInt(0,1)) ? ZC_BOOMER : ZC_SPITTER, TIMER_FLAG_NO_MAPCHANGE );
}
}
case ENC_BIGATTACK: {
for (new i = 0; i < iAmountValue; i++) {
CreateTimer( GetRandomFloat( 0.0, SPAWN_VARY_MAX ), Timer_SpawnSomething, GetRandomInt(ZC_SMOKER, ZC_CHARGER), TIMER_FLAG_NO_MAPCHANGE );
}
}
case ENC_FALLEN: {
// spawn some commons => fallen
new spawningclient = GetSpawningClient(true);
g_iRemainingFallen = iAmountValue;
if (IsClientAndInGame(spawningclient)) {
SpawnCommon(spawningclient, iAmountValue);
}
}
case ENC_WITCHES: {
for (new i = 0; i < iAmountValue; i++) {
CreateTimer(GetRandomFloat(0.0, SPAWN_VARY_MAX), Timer_SpawnSomething, ZC_WITCH, TIMER_FLAG_NO_MAPCHANGE);
}
}
}
}
// reset all timers back to 0
AcceptEntityInput(g_iLogicTimerEntEncounter[0], "Disable");
AcceptEntityInput(g_iLogicTimerEntEncounter[1], "Disable");
AcceptEntityInput(g_iLogicTimerEntEncounter[2], "Disable");
AcceptEntityInput(g_iLogicTimerEntAmount[0], "Disable");
AcceptEntityInput(g_iLogicTimerEntAmount[1], "Disable");
AcceptEntityInput(g_iLogicTimerEntAmount[2], "Disable");
AcceptEntityInput(g_iLogicTimerEntAmount[3], "Disable");
}
return Plugin_Continue;
}
public Action: Timer_SpawnSomething (Handle:timer, any:what)
{
// relay to spawn function
new client = GetSpawningClient(true);
PrintDebug(3, "[rand-coop] Spawning... client: %i.", client);
if (! IsClientAndInGame(client)) {
return Plugin_Continue;
}
PrintDebug(3, "[rand-coop] Spawning something: %i.", what);
switch (what) {
case ZC_SMOKER: { SpawnSpecial( client, what ); }
case ZC_BOOMER: { SpawnSpecial( client, what ); }
case ZC_HUNTER: { SpawnSpecial( client, what ); }
case ZC_SPITTER: { SpawnSpecial( client, what ); }
case ZC_JOCKEY: { SpawnSpecial( client, what ); }
case ZC_CHARGER: { SpawnSpecial( client, what ); }
case ZC_WITCH: { SpawnWitch(client); }
//case ZC_TANK: { SpawnTank(client); }
}
return Plugin_Continue;
}
public OnEntityCreated(entity, const String:classname[])
{
if (! StrEqual(classname, "infected", false)) {
return;
}
if (g_iRemainingFallen) {
g_iRemainingFallen--;
SetEntityModel(entity, FALLEN_MODEL);
}
}
// General functions
// ------------------------------
public PrintDebug(debugLevel, const String:Message[], any:...)
{
if (debugLevel <= GetConVarInt(g_hCvarDebug)) {
decl String:DebugBuff[256];
VFormat(DebugBuff, sizeof(DebugBuff), Message, 3);
LogMessage(DebugBuff);
PrintToServer(DebugBuff);
}
}
bool: IsClientAndInGame(index)
{
return (index > 0 && index <= MaxClients && IsClientInGame(index));
}
bool: IsSurvivor(client)
{
if (IsClientAndInGame(client)) {
return GetClientTeam(client) == TEAM_SURVIVOR;
}
return false;
}
bool: IsInfected(client)
{
if (IsClientAndInGame(client)) {
return GetClientTeam(client) == TEAM_INFECTED;
}
return false;
}
// get just any survivor client (param = false = switch to infected too)
int GetSpawningClient (bool:onlySurvivors = false)
{
for (new i = 1; i <= MaxClients; i++) {
if (IsClientConnected(i) && IsSurvivor(i) && !IsFakeClient(i) ) {
return i;
}
}
if (onlySurvivors) {
return 0;
}
// since we're just using this for spawning stuff that requires a client, use infected alternatively
for (new i = 1; i <= MaxClients; i++) {
if (IsClientConnected(i) && IsInfected(i) && !IsFakeClient(i)) {
return i;
}
}
// no usable clients...
return 0;
}
// Spawning infected
// ------------------
// spawning a zombie (cheap way :()
void SpawnCommon(client, mobs = 1)
{
if (USE_OLD_SPAWN) {
new flags = GetCommandFlags("z_spawn_old");
SetCommandFlags("z_spawn_old", flags & ~FCVAR_CHEAT);
for(new i=0; i < mobs; i++) {
FakeClientCommand(client, "z_spawn_old infected auto");
}
SetCommandFlags("z_spawn_old", flags);
} else {
new flags = GetCommandFlags("z_spawn");
SetCommandFlags("z_spawn", flags & ~FCVAR_CHEAT);
for (new i = 0; i < mobs; i++) {
FakeClientCommand(client, "z_spawn infected auto");
}
SetCommandFlags("z_spawn", flags);
}
}
// spawning a SI
SpawnSpecial(client, siClass)
{
PrintDebug(4, "[rand-coop] Spawning something...");
if (USE_OLD_SPAWN) {
new flags = GetCommandFlags("z_spawn_old");
SetCommandFlags("z_spawn_old", flags & ~FCVAR_CHEAT);
switch ( siClass ) {
case ZC_SMOKER: { FakeClientCommand(client, "z_spawn_old smoker auto"); }
case ZC_BOOMER: { FakeClientCommand(client, "z_spawn_old boomer auto"); }
case ZC_HUNTER: { FakeClientCommand(client, "z_spawn_old hunter auto"); }
case ZC_SPITTER: { FakeClientCommand(client, "z_spawn_old spitter auto"); }
case ZC_JOCKEY: { FakeClientCommand(client, "z_spawn_old jockey auto"); }
case ZC_CHARGER: { FakeClientCommand(client, "z_spawn_old charger auto"); }
}
SetCommandFlags("z_spawn_old", flags);
} else {
new flags = GetCommandFlags("z_spawn");
SetCommandFlags("z_spawn", flags & ~FCVAR_CHEAT);
switch ( siClass ) {
case ZC_SMOKER: { FakeClientCommand(client, "z_spawn_old smoker auto"); }
case ZC_BOOMER: { FakeClientCommand(client, "z_spawn_old boomer auto"); }
case ZC_HUNTER: { FakeClientCommand(client, "z_spawn_old hunter auto"); }
case ZC_SPITTER: { FakeClientCommand(client, "z_spawn_old spitter auto"); }
case ZC_JOCKEY: { FakeClientCommand(client, "z_spawn_old jockey auto"); }
case ZC_CHARGER: { FakeClientCommand(client, "z_spawn_old charger auto"); }
}
SetCommandFlags("z_spawn", flags);
}
}
// spawning a witch
SpawnWitch(client)
{
if (USE_OLD_SPAWN) {
new flags = GetCommandFlags("z_spawn_old");
SetCommandFlags("z_spawn_old", flags & ~FCVAR_CHEAT);
FakeClientCommand(client, "z_spawn_old witch auto");
SetCommandFlags("z_spawn_old", flags);
} else {
new flags = GetCommandFlags("z_spawn");
SetCommandFlags("z_spawn", flags & ~FCVAR_CHEAT);
FakeClientCommand(client, "z_spawn witch auto");
SetCommandFlags("z_spawn", flags);
}
}
public Action: SpawnFallen(number, Float:location[3])
{
// Don't spawn a fallen if we shouldn't
if (GetConVarFloat(g_hCvarFallenChance) < 0.01) {
return;
}
new zombie = CreateEntityByName("infected");
SetEntityModel(zombie, FALLEN_MODEL);
new ticktime = RoundToNearest((GetGameTime() / GetTickInterval())) + 5;
SetEntProp(zombie, Prop_Data, "m_nNextThinkTick", ticktime);
DispatchSpawn(zombie);
ActivateEntity(zombie);
location[2] -= 25.0; //reduce the 'drop' effect
TeleportEntity( zombie, location, NULL_VECTOR, NULL_VECTOR );
}
// ---------- Difficulty ------------
public Action: RandomDifficulty_Cmd(client, args)
{
decl String:sDifficulty[5];
if (! args) {
if (g_iCurrentDifficulty == COOP_DIFFICULTY_EASY) {
sDifficulty = "easy";
} else if (g_iCurrentDifficulty == COOP_DIFFICULTY_HARD) {
sDifficulty = "hard";
}
PrintToChat(client, "\x01[\x05r\x01] Current difficulty: '%s'. Change by specifying 'easy' or 'hard'", sDifficulty);
return Plugin_Handled;
}
GetCmdArg(1, sDifficulty, 5);
new iDifficulty = 0;
if (StrEqual(sDifficulty, "easy", false)) {
iDifficulty = COOP_DIFFICULTY_EASY;
} else if (StrEqual(sDifficulty, "hard", false)) {
iDifficulty = COOP_DIFFICULTY_HARD;
}
if (iDifficulty == 0) {
PrintToChat(client, "\x01[\x05r\x01] Incorrect argument: must be 'easy' or 'hard'");
return Plugin_Handled;
}
ChangeDifficulty(iDifficulty);
return Plugin_Handled;
}
void ChangeDifficulty(int difficulty)
{
if (g_iCurrentDifficulty == difficulty) {
PrintToChatAll("\x01[\x05r\x01] Difficulty is already set that way.");
return;
}
decl String: sPath[64];
decl String: sName[5];
if (difficulty == COOP_DIFFICULTY_EASY) {
g_iCurrentDifficulty = COOP_DIFFICULTY_EASY;
sName = "easy";
GetConVarString(g_hCvarPathToEasyConfig, sPath, 64);
} else if (difficulty == COOP_DIFFICULTY_HARD) {
g_iCurrentDifficulty = COOP_DIFFICULTY_HARD;
sName = "hard";
GetConVarString(g_hCvarPathToHardConfig, sPath, 64);
}
ExecDifficultyConfig(sPath);
PrintToChatAll("\x01[\x05r\x01] Changed coop difficulty to: %s.", sName);
}
void ExecDifficultyConfig(char[] path)
{
new String: sFullPath[64] = "cfg/";
StrCat(sFullPath, 64, path);
if (! FileExists(sFullPath)) {
PrintDebug(0, "[rand-coop] Could not find difficulty config file: %s", sFullPath);
return;
}
PrintToChatAll("\x01[\x05r\x01] Setting difficulty before 2");
PrintDebug(2, "[rand-coop] Executing config file: %s", sFullPath);
PrintToChatAll("\x01[\x05r\x01] Setting difficulty before 3");
ServerCommand("exec \"%s\"", path);
}