mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
make sure default pistol is given on cookiescached
This commit is contained in:
parent
5312c31253
commit
0591499471
@ -498,6 +498,11 @@ public void OnClientCookiesCached(int client)
|
||||
{
|
||||
gI_HUD2Settings[client] = StringToInt(sHUDSettings);
|
||||
}
|
||||
|
||||
if (gEV_Type != Engine_TF2 && IsValidClient(client, true) && GetClientTeam(client) > 1)
|
||||
{
|
||||
GivePlayerDefaultGun(client);
|
||||
}
|
||||
}
|
||||
|
||||
public void Player_ChangeClass(Event event, const char[] name, bool dontBroadcast)
|
||||
@ -930,14 +935,13 @@ public Action Hook_GunTouch(int entity, int client)
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public void Player_Spawn(Event event, const char[] name, bool dontBroadcast)
|
||||
void GivePlayerDefaultGun(int client)
|
||||
{
|
||||
int client = GetClientOfUserId(event.GetInt("userid"));
|
||||
if (!(gI_HUDSettings[client] & (HUD_GLOCK|HUD_USP)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsFakeClient(client))
|
||||
{
|
||||
if (gEV_Type != Engine_TF2 && (gI_HUDSettings[client] & (HUD_GLOCK|HUD_USP)))
|
||||
{
|
||||
int iSlot = CS_SLOT_SECONDARY;
|
||||
int iWeapon = GetPlayerWeaponSlot(client, iSlot);
|
||||
char sWeapon[32];
|
||||
@ -960,6 +964,17 @@ public void Player_Spawn(Event event, const char[] name, bool dontBroadcast)
|
||||
iWeapon = GivePlayerItem(client, sWeapon);
|
||||
FakeClientCommand(client, "use %s", sWeapon);
|
||||
}
|
||||
|
||||
public void Player_Spawn(Event event, const char[] name, bool dontBroadcast)
|
||||
{
|
||||
int client = GetClientOfUserId(event.GetInt("userid"));
|
||||
|
||||
if (!IsFakeClient(client))
|
||||
{
|
||||
if (gEV_Type != Engine_TF2)
|
||||
{
|
||||
GivePlayerDefaultGun(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user