return 1;
}
+void Karma_WarningCheck(entity it)
+{
+ float totalmeankarma = ((autocvar_g_mmm_max_karma_points + autocvar_g_mmm_min_karma_points + it.karmapoints) / 3);
+ if (it.karmapoints <= totalmeankarma)
+ {
+ Send_Notification(NOTIF_ONE_ONLY, it, MSG_INFO, INFO_MMM_KARMAWARNING);
+ //centerprint(it, strcat(BOLD_OPERATOR, "^1KARMA WARNING!\n^3Here, have the Rifle!"));
+ GiveWeapon(it, WEP_RIFLE.m_id, OP_PLUS, 1);
+ }
+}
+
void mmm_RoundStart()
{
allowed_to_spawn = boolean(warmup_stage);
FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
{
- float totalmeankarma = ((autocvar_g_mmm_max_karma_points + autocvar_g_mmm_min_karma_points + it.karmapoints) / 3);
karma_Control(it);
it.activekillerrole = false;
if(it.mmm_status == MMM_STATUS_CIVILIAN)
{
- if (it.karmapoints <= totalmeankarma)
- {
- centerprint(it, strcat(BOLD_OPERATOR, "^1KARMA WARNING!\n^3Here, have the Rifle!"));
- GiveWeapon(it, WEP_RIFLE.m_id, OP_PLUS, 1);
- }
+ Karma_WarningCheck(it);
//Gives Mine Layer weapon to the player
GiveWeapon(it, WEP_MINE_LAYER.m_id, OP_PLUS, 1);
Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_MMM_CIVILIAN);
}
else if(it.mmm_status == MMM_STATUS_MURDERER)
{
- if (it.karmapoints <= totalmeankarma)
- {
- centerprint(it, strcat(BOLD_OPERATOR, "^1KARMA WARNING!\n^3Here, have the Rifle!"));
- GiveWeapon(it, WEP_RIFLE.m_id, OP_PLUS, 1);
- }
+ Karma_WarningCheck(it);
//Gives Mine Layer weapon to the player
GiveWeapon(it, WEP_MINE_LAYER.m_id, OP_PLUS, 1);
Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_MMM_MURDERER);
}
else if(it.mmm_status == MMM_STATUS_SLEUTH)
{
- if (it.karmapoints <= totalmeankarma)
- {
- centerprint(it, strcat(BOLD_OPERATOR, "^1KARMA WARNING!\n^3Here, have the Rifle!"));
- GiveWeapon(it, WEP_RIFLE.m_id, OP_PLUS, 1);
- }
+ Karma_WarningCheck(it);
//Gives Shockwave and Mine Layer weapon to the player
GiveWeapon(it, WEP_SHOCKWAVE.m_id, OP_PLUS, 1);
GiveWeapon(it, WEP_MINE_LAYER.m_id, OP_PLUS, 1);
MUTATOR_HOOKFUNCTION(mmm, PlayerPreThink)
{
entity player = M_ARGV(0, entity);
-
+ int playercount = 0;
+ bool playercheck = false;
+
+ if (playercheck != true)
+ {
+ FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
+ {
+ ++playercount;
+ });
+ playercheck = true;
+ }
+
+ //if the murderer is still here around, then avoid illogical winning
+ if (playercheck == true)
+ {
+ FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
+ {
+ if (playercount == 3)
+ {
+ if (it.mmm_status == MMM_STATUS_SLEUTH)
+ it.mmm_status = MMM_STATUS_CIVILIAN;
+ }
+ });
+ }
+
if(IS_PLAYER(player) || player.caplayer)
{
if (player.karmaspectated != true)
MSG_INFO_NOTIF(MMM_SLEUTH, N_CHATCON, 0, 0, "", "", "", _("^BGYou are ^4Sleuth^BG!"), "")
MSG_INFO_NOTIF(MMM_WHOISSLEUTH, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s is ^4Sleuth^BG!"), "")
MSG_INFO_NOTIF(MMM_CORPSEDETECTION, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s"), "")
+ MSG_INFO_NOTIF(MMM_KARMAWARNING, N_CHATCON, 0, 0, "", "", "", _("^K1KARMA WARNING! ^3Here, have the Rifle!"), "")
MSG_INFO_NOTIF(VERSION_BETA, N_CONSOLE, 2, 0, "s1 s2", "", "", _("^F4NOTE: ^BGThe server is running ^F1Xonotic %s (beta)^BG, you have ^F2Xonotic %s"), "")
MSG_INFO_NOTIF(VERSION_OLD, N_CHATCON, 2, 0, "s1 s2", "", "", _("^F4NOTE: ^BGThe server is running ^F1Xonotic %s^BG, you have ^F2Xonotic %s"), "")