I'm running an XP-type mod on my server with a sort-of reverse CSDM Tickets running on it; whenever a player kills someone, they add to the team score, first team score to (x) wins. When a team wins, the losing team is supposed to be slayed while the winning team gets an XP rewards (dubbed totalkills[id] in the code below)
The problem is that I set the XP reward to be given to the winning players to 300 but it never gives that actual number. Instead, it gives something much larger, anywhere from 300 to 5000 and thats causing some
inflation in the server.
Anyone mind giving it a look? All the relevant code is posted below:
Some extra notes: -Using the CSDM define a bunch of times within the mod, so the csdm_PostDeath is off CSDM.
- totalkills[id] is the variable for the XP i'm trying to hand out on win.
Code:
new g_WinTeam
new g_LoseTeam
new g_Respawns[3]
public csdm_RoundRestart()
{
g_Respawns[_TEAM_T] = 0
g_Respawns[_TEAM_CT] = 0
}
public csdm_PostDeath(killer, victim, headshot, const weapon[])
{
new death = get_user_team(victim)
new kill = get_user_team(killer)
if (g_Respawns[kill] >= 1500)
{
g_WinTeam = kill;
g_LoseTeam = death;
round_win();
}
else
{
g_Respawns[kill] += 10;
}
return PLUGIN_CONTINUE
}
public round_win()
{
new g_players[32], num;
get_players(g_players, num);
new x;
for(new i = 0; i < num; i++)
{
x = g_players[i];
if(get_user_team(x) == g_LoseTeam)
{
user_silentkill(x);
cs_set_user_deaths(x, get_user_deaths(x) - 1);
}
else if(get_user_team(x) == g_WinTeam)
{
new killpts = 300;
totalkills[x] += killpts;
client_cmd(x, "spk %s", gKillstreak);
}
}
}
__________________