diff --git a/plugins/l4d2_extraplayeritems.smx b/plugins/l4d2_extraplayeritems.smx index c90dfe3..a8595a4 100644 Binary files a/plugins/l4d2_extraplayeritems.smx and b/plugins/l4d2_extraplayeritems.smx differ diff --git a/scripting/l4d2_extraplayeritems.sp b/scripting/l4d2_extraplayeritems.sp index e85fbb5..6a98f28 100644 --- a/scripting/l4d2_extraplayeritems.sp +++ b/scripting/l4d2_extraplayeritems.sp @@ -44,7 +44,7 @@ public Plugin myinfo = }; static ConVar hExtraItemBasePercentage, hAddExtraKits, hMinPlayers, hUpdateMinPlayers, hMinPlayersSaferoomDoor, hSaferoomDoorWaitSeconds, hSaferoomDoorAutoOpen; -static int extraKitsAmount = 4, extraKitsStarted, abmExtraCount, firstSaferoomDoorEntity, playersLoadedIn, playerstoWaitFor; +static int extraKitsAmount, extraKitsStarted, abmExtraCount, firstSaferoomDoorEntity, playersLoadedIn, playerstoWaitFor; static int isBeingGivenKit[MAXPLAYERS+1]; static bool isCheckpointReached, isLateLoaded, firstGiven, isFailureRound, isGameFrozen; static ArrayList ammoPacks; @@ -277,6 +277,8 @@ public void Event_RoundFreezeEnd(Event event, const char[] name, bool dontBroadc if(!isLateLoaded) PopulateItems(); int client = FindFirstSurvivor(); + if(client <= 0) return; //Ignore if no players + float survPos[3], doorPos[3]; GetClientAbsOrigin(client, survPos); if(hMinPlayersSaferoomDoor.FloatValue > 0.0) { @@ -428,9 +430,8 @@ public Action OnUpgradePackUse(int entity, int activator, int caller, UseType ty Prioritize first aid kits somehow? Or split two groups: "utility" (throwables, kits, pill/shots), and "weapon" (all other spawns) */ public void PopulateItems() { - // int survivors = GetRealSurvivorsCount(); - // if(survivors <= 4) return; - int survivors = 5; + int survivors = GetRealSurvivorsCount(); + if(survivors <= 4) return; float percentage = hExtraItemBasePercentage.FloatValue * survivors; PrintToServer("Populating extra items based on player count (%d) | Percentage %f%%", survivors, percentage * 100);