Skip to content

Commit 3cae12e

Browse files
committed
Fixed No Connected Pins
1 parent f838fe9 commit 3cae12e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

plugins/bowling.smx

212 Bytes
Binary file not shown.

scripting/bowling.sp

+21
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ public void OnClientPutInServer(int iClient)
406406
if (IsValidClient(iClient))
407407
if (IsFakeClient(iClient))
408408
ChangeClientTeam(iClient, 1);
409+
410+
if (!IsFakeClient(iClient))
411+
Bowl_VerifyPins();
409412
}
410413

411414
public void OnClientDisconnect(int iClient) {
@@ -1925,6 +1928,12 @@ public Action Bowl_EndSession(Handle hTimer, int iLane)
19251928
PrintToChatAll("\x07ADFF2FThe session on Lane %i has just ended. The lane is now open.\n%s", iLane, sFormatChat);
19261929
}
19271930

1931+
stock void Bowl_VerifyPins()
1932+
{
1933+
if (GetPinCount() == 0)
1934+
Bowl_ConnectPins();
1935+
}
1936+
19281937
stock void Bowl_ConnectPins()
19291938
{
19301939
ServerCommand("sv_cheats 1; bot_kick all; bot -team red -class medic -name Pin#1; bot -team red -class medic -name Pin#2; bot -team red -class medic -name Pin#3; bot -team red -class medic -name Pin#4; bot -team red -class medic -name Pin#5; bot -team red -class medic -name Pin#6;");
@@ -2286,6 +2295,18 @@ public Action Timer_DeleteParticles(Handle hTimer, int iParticle)
22862295
}
22872296
}
22882297

2298+
stock int GetPinCount()
2299+
{
2300+
int iCount;
2301+
for (int i = 1; i <= MaxClients; i++)
2302+
{
2303+
if (IsValidClient(i) && IsFakeClient(i))
2304+
iCount++;
2305+
}
2306+
2307+
return iCount;
2308+
}
2309+
22892310
stock bool IsValidClient(int iClient, bool bReplay = true)
22902311
{
22912312
if (iClient <= 0 || iClient > MaxClients || !IsClientInGame(iClient))

0 commit comments

Comments
 (0)