Skip to content

Commit

Permalink
Merge branch 'SirPlease:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
altair-sossai authored Oct 29, 2024
2 parents 41e5bce + 16e0827 commit 634ebd5
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions addons/sourcemod/scripting/include/l4d2_penalty_bonus.inc
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
/*
Includes for Penalty bonus system (l4d2_penalty_bonus)
------------------------------------------------------
Includes for Penalty bonus system (l4d2_penalty_bonus)
------------------------------------------------------
*/

#if defined _l4d2_penalty_bonus_included_
#endinput
#endif
#define _l4d2_penalty_bonus_included_

/**
* Called when a round is about to end.
* The update value is passed by reference and increased by any plugin using this forward
Expand All @@ -12,25 +17,48 @@
* @param int update (by reference) the value of the cumulative update PBonus needs to know
* @return int the update value to add to the round's bonus
*/
forward OnHoldOutBonusSet( &update );
forward int PBONUS_RequestFinalUpdate( int &update );


// Get the bonus for the current round
// returns int
native PBONUS_GetRoundBonus();
native int PBONUS_GetRoundBonus();

// Resets the bonus for the current round to 0 (does not do a change-report!)
native PBONUS_ResetRoundBonus();
native void PBONUS_ResetRoundBonus();

// Set the bonus for the current round
native PBONUS_SetRoundBonus(bonus);
native void PBONUS_SetRoundBonus(int bonus);

// Adds points to the bonus for the current round
native PBONUS_AddRoundBonus(bonus, bool:bNoReport=false);
native void PBONUS_AddRoundBonus(int bonus, bool bNoReport=false);

// Get the amount of defibs used in the current round
// returns int
native PBONUS_GetDefibsUsed();
native int PBONUS_GetDefibsUsed();

// Set the (current) defib penalty
native PBONUS_SetDefibPenalty(penalty);
native void PBONUS_SetDefibPenalty(penalty);

public SharedPlugin __pl_l4d2_penalty_bonus =
{
name = "penaltybonus",
file = "l4d2_penalty_bonus.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};

#if !defined REQUIRE_PLUGIN
public void __pl_l4d2_penalty_bonus_SetNTVOptional()
{
MarkNativeAsOptional("PBONUS_GetRoundBonus");
MarkNativeAsOptional("PBONUS_ResetRoundBonus");
MarkNativeAsOptional("PBONUS_SetRoundBonus");
MarkNativeAsOptional("PBONUS_AddRoundBonus");
MarkNativeAsOptional("PBONUS_GetDefibsUsed");
MarkNativeAsOptional("PBONUS_SetDefibPenalty");
}
#endif

0 comments on commit 634ebd5

Please sign in to comment.