#include "sv_mmm.qh"
//set g_mmm_sleuth_count 0.125 "number of players who will become sleuths, set between 0 and 0.9 to use a multiplier of the current players, or 1 and above to specify an exact number of players"
-//float autocvar_g_mmm_sleuth_count = 0.125; //I don't think that it won't be used...
+//float autocvar_g_mmm_sleuth_count = 0.125; //I don't think that it'll be used...
float autocvar_g_mmm_civilian_count = 0.625;
//float autocvar_g_mmm_murderer_count = 0.25;
float autocvar_g_mmm_round_timelimit = 180;
bool autocvar_g_mmm_reward_sleuth = true; //sleuth reward if investigated corpses
float autocvar_g_mmm_max_karma_points = 1000; //LegendGuard sets Karma points 21-02-2021
float autocvar_g_mmm_min_karma_points = 400;
-int autocvar_g_mmm_karma_bankick_tool = 0; //LegendGuard sets a ban tool for server admins 11-03-2021
+int autocvar_g_mmm_karma_bankick_tool = 1; //LegendGuard sets a ban tool for server admins 11-03-2021
float autocvar_g_mmm_karma_bantime = 1800; //karma ban seconds
bool autocvar_g_mmm_karma_damageactive = true; //LegendGuard sets Karma damage setting if active 20-03-2021
float autocvar_g_mmm_karma_severity = 0.25;
float autocvar_g_mmm_karma_damagepunishmentdeal = 20; //LegendGuard sets Karma punishment damage setting if player kills an ally 28-03-2021
// Sleuth is a created team, this team is added inside Civilians team
+/*scoreboard.qc method
+void KarmaScore_GetField(entity pl, PlayerScoreField field)
+{
+ if (field == SP_MMM_KARMA)
+ float karmap = pl.(scores(SP_MMM_KARMA));
+}*/
+
void mmm_FakeTimeLimit(entity e, float t)
{
if(!IS_REAL_CLIENT(e))
{
switch (autocvar_g_mmm_karma_bankick_tool)
{
+ //do nothing
+ case 0: return;
//force to spec
- case 0: PutObserverInServer(it); return;
+ case 1: PutObserverInServer(it); return;
//kick
- case 1: dropclient(it); return;
+ case 2: dropclient(it); return;
//ban and kick
- case 2: Ban_KickBanClient(it, bantime, masksize, "Too low karma"); return;
- //force to spec
+ case 3: Ban_KickBanClient(it, bantime, masksize, "Too low karma"); return;
default: PutObserverInServer(it); return;
}
}
int playercount = 0;
FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
- {
+ {
//PrintToChatAll(sprintf("it.karmapoints ^5begin: ^3%f",it.karmapoints));
- //Karma points start
- if (it.karmastarted != true)
- {
- GameRules_scoring_add(it, MMM_KARMA, autocvar_g_mmm_max_karma_points - it.karmapoints);
- it.karmapoints = autocvar_g_mmm_max_karma_points;
- it.karmastarted = true;
- }
karma_Control(it);
++playercount;
//PrintToChatAll(sprintf("it.karmapoints ^6end: ^3%f",it.karmapoints));
if(IS_PLAYER(player) || player.caplayer)
{
+ if (player.karmaspectated != true)
+ {
+ if (CS(player).scorekeeper.(scores(SP_MMM_KARMA)) <= 0) //wtf? Visualization works 100% correct?
+ GameRules_scoring_add(player, MMM_KARMA, player.karmapoints);
+ player.karmaspectated = true;
+ }
// update the scoreboard colour display to out the real killer at the end of the round
// running this every frame to avoid cheats
int plcolor = MMM_COLOR_CIVILIAN;
plcolor = MMM_COLOR_SLEUTH;
setcolor(player, plcolor);
}
+ if(warmup_stage)
+ player.karmastarted = false;
//CORPSE FEATURE 10-03-2021
if (IS_DEAD(player))
MUTATOR_HOOKFUNCTION(mmm, PlayerSpawn)
{
entity player = M_ARGV(0, entity);
+
+ //Karma points start
+ if (player.karmastarted != true)
+ {
+ player.karmapoints = autocvar_g_mmm_max_karma_points;
+ GameRules_scoring_add(player, MMM_KARMA, player.karmapoints);
+ player.karmastarted = true;
+ }
player.mmm_status = 0;
player.mmm_validkills = 0;
if (IS_PLAYER(player) && !IS_DEAD(player))
mmm_LastPlayerForTeam_Notify(player);
+ if (player.karmaspectated == true)
+ player.karmaspectated = false;
if (player.killindicator_teamchange == -2) // player wants to spectate
player.caplayer = 0;
if (player.caplayer)