mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 14:13:20 +00:00
Merge branch 'master' of github.com:Jackzmc/sourcemod-plugins
This commit is contained in:
commit
5b60b8a95f
34 changed files with 2116 additions and 236 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Left 4 DHooks Direct - Stock Functions
|
||||
* Copyright (C) 2021 Silvers
|
||||
* Copyright (C) 2022 Silvers
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -827,7 +827,10 @@ stock int GetAnyRandomClient()
|
|||
}
|
||||
|
||||
if( aClients.Length > 0 )
|
||||
{
|
||||
SetRandomSeed(GetGameTickCount());
|
||||
client = aClients.Get(GetRandomInt(0, aClients.Length - 1));
|
||||
}
|
||||
|
||||
delete aClients;
|
||||
|
||||
|
@ -866,7 +869,7 @@ stock int Local_GetRandomClient(int team, int alive = -1, int bots = -1)
|
|||
|
||||
for( int i = 1; i <= MaxClients; i++ )
|
||||
{
|
||||
if( IsClientInGame(i) && GetClientTeam(i) == team && (alive == -1 || IsPlayerAlive(i) == view_as<bool>(alive)) && (bots == -1 || IsFakeClient(i) == view_as<bool>(alive)) )
|
||||
if( IsClientInGame(i) && GetClientTeam(i) == team && (alive == -1 || IsPlayerAlive(i) == view_as<bool>(alive)) && (bots == -1 || IsFakeClient(i) == view_as<bool>(bots)) )
|
||||
{
|
||||
aClients.Push(i);
|
||||
}
|
||||
|
@ -875,7 +878,10 @@ stock int Local_GetRandomClient(int team, int alive = -1, int bots = -1)
|
|||
int client;
|
||||
|
||||
if( aClients.Length > 0 )
|
||||
{
|
||||
SetRandomSeed(GetGameTickCount());
|
||||
client = aClients.Get(GetRandomInt(0, aClients.Length - 1));
|
||||
}
|
||||
|
||||
delete aClients;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue