Skip to content

Commit

Permalink
fix some problem
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasylidong committed May 4, 2024
1 parent 718376c commit 692cbf2
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 3 deletions.
Binary file modified addons/sourcemod/plugins/extend/join.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/extend/rygive.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/AnneHappy/infected_control.smx
Binary file not shown.
1 change: 1 addition & 0 deletions addons/sourcemod/scripting/AnneHappy/infected_control.sp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public void OnPluginStart()
g_hEnableSIoption.AddChangeHook(ConVarChanged_Cvars);
g_hAllChargerMode.AddChangeHook(ConVarChanged_Cvars);
g_hAllHunterMode.AddChangeHook(ConVarChanged_Cvars);
g_hAntiBaitMode.AddChangeHook(ConVarChanged_Cvars);
g_hAutoSpawnTimeControl.AddChangeHook(ConVarChanged_Cvars);
g_hAddDamageToSmoker.AddChangeHook(ConVarChanged_Cvars);
g_hSiLimit.AddChangeHook(MaxPlayerZombiesChanged_Cvars);
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/AnneHappy/join.sp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void OnClientPutInServer(int client)
}

if(g_bGroupSystemAvailable){
if(!Veterans_Get(client, view_as<TARGET_OPTION_INDEX>(GOURP_MEMBER))){
if(!Veterans_Get(client, view_as<TARGET_OPTION_INDEX>(GOURP_MEMBER)) || !(CheckCommandAccess(client, "", ADMFLAG_SLAY))){
ShowMotdToPlayer(client);
}
}else{
Expand Down
47 changes: 45 additions & 2 deletions addons/sourcemod/scripting/extend/rygive.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1812,10 +1812,20 @@ int SwitchPlayerTeam_MenuHandler(Menu menu, MenuAction action, int client, int p
}

case 2:
ChangeTeamToSurvivor(target, team);
{
if(IsSuivivorTeamFull())
PrintToChat(client, "生还已满");
else
ChangeTeamToSurvivor(target, team);
}

case 3:
ChangeClientTeam(target, targetTeam);
{
if(IsInfectTeamFull())
PrintToChat(client, "感染者已满");
else
ChangeClientTeam(target, targetTeam);
}
}
}
else
Expand All @@ -1839,6 +1849,39 @@ int SwitchPlayerTeam_MenuHandler(Menu menu, MenuAction action, int client, int p
return 0;
}

//判断生还是否已经满人
stock bool IsSuivivorTeamFull()
{
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && GetClientTeam(i) == 2 && IsPlayerAlive(i) && IsFakeClient(i))
{
return false;
}
}
return true;
}

//判断特感是否已经满人
stock bool IsInfectTeamFull()
{
int count = 0;
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && GetClientTeam(i) == 3)
{
count ++;
}
}
if(count >= FindConVar("z_max_player_zombies").IntValue){
return true;
}
else
{
return false;
}
}

void ChangeTeamToSurvivor(int client, int team) {
if (GetEntProp(client, Prop_Send, "m_isGhost"))
SetEntProp(client, Prop_Send, "m_isGhost", 0);
Expand Down

0 comments on commit 692cbf2

Please sign in to comment.