mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-07 00:13:20 +00:00
Hopefully fix PeekCam
This commit is contained in:
parent
c2e446750c
commit
e473cbe3ee
4 changed files with 71 additions and 33 deletions
|
@ -197,8 +197,6 @@ methodmap PeekCamera {
|
|||
AcceptEntityInput(seekerCam, "Enable", client); // Need to always activate before deactivating to fix a semi-common bug
|
||||
if(!active) {
|
||||
AcceptEntityInput(seekerCam, "Disable", client);
|
||||
AcceptEntityInput(seekerCam, "Kill");
|
||||
seekerCam = INVALID_ENT_REFERENCE;
|
||||
}
|
||||
} else {
|
||||
PrintToServer("WARN: SetPeekCamActive(%d, %b) when seekerCam invalid", client, active);
|
||||
|
@ -206,6 +204,19 @@ methodmap PeekCamera {
|
|||
isViewingCam[client] = active;
|
||||
}
|
||||
|
||||
public void Enable(int client = -1) {
|
||||
AcceptEntityInput(seekerCam, "Enable", client);
|
||||
if(client > 0) {
|
||||
isViewingCam[client] = true;
|
||||
}
|
||||
}
|
||||
public void Disable(int client = -1) {
|
||||
AcceptEntityInput(seekerCam, "Disable", client);
|
||||
if(client > 0) {
|
||||
isViewingCam[client] = false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsViewing(int client) {
|
||||
return isViewingCam[client];
|
||||
}
|
||||
|
|
|
@ -62,19 +62,21 @@ void SetSlasher(int client, bool ignoreBalance = false) {
|
|||
ignoreSeekerBalance = true;
|
||||
}
|
||||
GameState state = GetState();
|
||||
char buf[128];
|
||||
char buf[256];
|
||||
ArrayList hiders = new ArrayList();
|
||||
for(int i = 1; i <= MaxClients; i++) {
|
||||
if(IsClientConnected(i) && IsClientInGame(i) && i != client && GetClientTeam(i) == 2) {
|
||||
if(IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == 2) {
|
||||
for(int s = 0; s < 6; s++) {
|
||||
int ent = GetPlayerWeaponSlot(i, s);
|
||||
if(ent > 0) AcceptEntityInput(ent, "Kill");
|
||||
}
|
||||
hiders.Push(i);
|
||||
if(state == State_Hunting)
|
||||
CheatCommand(i, "give", "pistol_magnum");
|
||||
else
|
||||
CheatCommand(i, "give", "knife");
|
||||
if(i != client) {
|
||||
hiders.Push(i);
|
||||
if(state == State_Hunting)
|
||||
CheatCommand(i, "give", "pistol_magnum");
|
||||
else
|
||||
CheatCommand(i, "give", "knife");
|
||||
}
|
||||
}
|
||||
}
|
||||
int defibHolder = hiders.Get(GetRandomInt(0, hiders.Length - 1));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue