Quote:
Originally Posted by thewintersoldier97
Hello, can someone create a plugin that check and spawn additional medkit for extra players on safe room or before the holdout/scavenge finales event start like the feature on Shao's Superversus 2.5 or link me to a plugin that still working with similar feature?
Any help is greatly appreciated!
|
You can copy the code from
his post,
PHP Code:
public void OnPluginStart()
{
HookEvent("finale_start", Event_FinaleStart, EventHookMode_Post);
}
// ------------------------------------------------------------------------
// Spawn extra medkits at the finale based on survivors on the team after the finale starts.
// ------------------------------------------------------------------------
public void Event_FinaleStart(Event event, const char[] name, bool dontBroadcast)
{
if(FinaleExtraFirstAid.BoolValue)
{
int client = GetAnyAliveSurvivor();
int amount = GetSurvivorTeam() - 4;
if(amount > 0 && client > 0)
{
for(int i = 1; i <= amount; i++)
{
CheatCommand(client, "give", "first_aid_kit", "");
}
}
}
}
void CheatCommand(int client, const char[] command, const char[] argument1, const char[] argument2)
{
int userFlags = GetUserFlagBits(client);
SetUserFlagBits(client, ADMFLAG_ROOT);
int flags = GetCommandFlags(command);
SetCommandFlags(command, flags & ~FCVAR_CHEAT);
FakeClientCommand(client, "%s %s %s", command, argument1, argument2);
SetCommandFlags(command, flags);
SetUserFlagBits(client, userFlags);
}
search string "first_aid_kit"
__________________