Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
Split the regenerate logic for the antihack into a separate call. Fix…
Browse files Browse the repository at this point in the history
…es propmenu / propreroll giving players their health back.
  • Loading branch information
powerlord committed May 16, 2015
1 parent 6ea2c9e commit 75fe454
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions addons/sourcemod/scripting/prophunt.sp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: 3.3.1
* Version: 3.3.2
*/
// PropHunt Redux by Powerlord
// Based on
Expand Down Expand Up @@ -60,7 +60,7 @@

#define MAXLANGUAGECODE 4

#define PL_VERSION "3.3.1"
#define PL_VERSION "3.3.2"
//--------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------- MAIN PROPHUNT CONFIGURATION -------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -4221,7 +4221,7 @@ public Action:Event_player_death(Handle:event, const String:name[], bool:dontBro
public Action:Timer_WeaponAlpha(Handle:timer, any:userid)
{
new client = GetClientOfUserId(userid);
if(client != 0 && IsClientInGame(client) && IsPlayerAlive(client))
if(client > 0 && IsClientInGame(client) && IsPlayerAlive(client))
SetWeaponsAlpha(client, 0);
}

Expand Down Expand Up @@ -4311,7 +4311,7 @@ public Action:Timer_DoEquip(Handle:timer, any:UserId)
new client = GetClientOfUserId(UserId);
if(client > 0 && IsClientInGame(client) && IsPlayerAlive(client))
{
TF2_RegeneratePlayer(client);
//TF2_RegeneratePlayer(client);

#if defined LOG
LogMessage("[PH] do equip %N", client);
Expand Down Expand Up @@ -4473,7 +4473,8 @@ public Action:Timer_AntiHack(Handle:timer, any:entity)
//ForcePlayerSuicide(client);
g_PlayerModel[client] = "";
//TF2_RemoveAllWeapons(client);
Timer_DoEquip(INVALID_HANDLE, GetClientUserId(client));
//Timer_DoEquip(INVALID_HANDLE, GetClientUserId(client));
CreateTimer(0.1, Timer_FixPropPlayer, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
}
}
}
Expand All @@ -4482,6 +4483,19 @@ public Action:Timer_AntiHack(Handle:timer, any:entity)
return Plugin_Continue;
}

// Fix a prop player who still has
public Action:Timer_FixPropPlayer(Handle:timer, any:userid)
{
new client = GetClientOfUserId(userid);
if (client < 1 || GetClientTeam(client) != TEAM_PROP)
return Plugin_Handled;

TF2_RegeneratePlayer(client);
Timer_DoEquip(INVALID_HANDLE, userid);

return Plugin_Handled;
}

public QueryStaticProp(QueryCookie:cookie, client, ConVarQueryResult:result, const String:cvarName[], const String:cvarValue[])
{
if (result == ConVarQuery_Okay)
Expand Down

0 comments on commit 75fe454

Please sign in to comment.