I'm having trouble saving trial special functions if a player hasn't died yet and making them carry over to the next round. I edited the SP file to save points and reset trial special functions when a player dies, instead of at the end of a round. I commented out
RoundReset() in
RoundStart and
RoundEnd and added the code under
Event_PlayerDeath:
Code:
public Action Event_PlayerDeath(Event event, char[] event_name, bool dontBroadcast)
{
if(!g_bPointsOn) return Plugin_Continue;
int client = GetClientOfUserId(event.GetInt("userid"));
int attacker = GetClientOfUserId(event.GetInt("attacker"));
if (IsSurvivor(attacker) && IsInfected(client))
{
int points = cvar_earn_special.IntValue;
if(AddPoints(attacker, points))
CPrintToChat(attacker, "%T%T%T%T", "SYSTEM", attacker, "KILLED_SPECIAL_INFECTED", attacker, "REWARD_POINTS", attacker, points, "ADVERTISEMENT", attacker);
}
else if(IsInfected(attacker) && IsSurvivor(client))
{
int points = cvar_iearn_survivor.IntValue;
if(AddPoints(attacker, points))
CPrintToChat(attacker, "%T%T%T%T", "SYSTEM", attacker, "KILLED_SURVIVOR", attacker, "REWARD_POINTS", attacker, points, "ADVERTISEMENT", attacker);
}
if (client && IsValidClient(client) && !IsFakeClient(client))
{
SaveToDB(client);
RoundResetClient(client);
}
return Plugin_Continue;
}
But, the trial special functions don't transfer to the next round. I'd appreciate any help with fixing this as well.