[HELP] Enable or disable plugins
-
the_bad_boy I don't think it's possible, since plugins are loaded on server startup, not like scripts that are loaded on every map rotation.
-
Kalitos does that mean that the scripts can be uploaded and downloaded?
-
the_bad_boy Well, which is what you want to do, it sounds more like you use a script instead of a plugin.
-
the_bad_boy And yes, with a script, you can, based on variables, determine if it runs in a game mode or not.
-
Kalitos ok I have the Cranked script and I want it to run in TDM_default how would it be?
-
the_bad_boy You could use in such a way that you compare the game mode.
if(getDvar("g_gametype")=="war") //If is TDM mode { //load the script here }
-
Kalitos so it should be like this?
if(getDvar("g_gametype")=="war") //If is TDM mode { #include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\gametypes\_hud_util; /** IW5 Cranked. Updated: 14/06/2021. Version: 1.0. Author: Birchy. Description: IW5 custom script that adds 'cranked' behaviour present in other titles. Works for every gamemode. */ init(){ level.crankedtime = 20; level.crankedoverlay = 0.25; level thread connect(); } connect(){ for(;;){ level waittill("connected", player); player thread cranked(); } } cranked(){ self endon("disconnect"); self.crankedhud[0] = drawshader("white", "TOP", "CENTER", -190, 90, 75, 25, (0.6,0.8,0.6), 0, 1); self.crankedhud[1] = drawshader("white", "TOP", "CENTER", -190, 115, 75, 10, (0,0,0), 0, 1); self.crankedhud[2] = drawtext(&"0:", "TOP", "CENTER", -190, 90, 1, "bigfixed", (1,1,1), 0, 2); self.crankedhud[3] = drawtext(&"CRANKED", "TOP", "CENTER", -190, 114, 1, "objective", (1,1,1), 0, 2); self.crankedhud[4] = drawoverlay(); for(;;){ event = self waittill_any_return("death", "spawned_player", "killed_enemy"); if(event == "killed_enemy"){ self effects(); self display(true); self thread timer(); }else{ self display(false); } } } timer(){ self endon("disconnect"); self endon("death"); self endon("killed_enemy"); time = level.crankedtime; self.crankedhud[2] setvalue(time); self.crankedhud[2].color = (1,1,1); self.crankedhud[2].label = &"0:"; //TODO: Including milliseconds would probably look nice. while(time != 0){ wait 1; time -= 1; self.crankedhud[2] setvalue(time); self playlocalsound("trophy_detect_projectile"); if(time < 10){ self.crankedhud[2].label = &"0:0"; if(time <= 5 && time != 0){ self.crankedhud[2].color = (0.8,0.2,0.2); self playsound("ui_mp_suitcasebomb_timer"); } } } self playsound("detpack_explo_default"); playfx(level.c4death, self.origin); self suicide(); } effects(){ self setperk("specialty_fastermelee", true, false); self setperk("specialty_lightweight", true, false); self setperk("specialty_fastreload", true, false); self setperk("specialty_longersprint", true, false); self setperk("specialty_quickdraw", true, false); self setperk("specialty_stalker", true, false); self setperk("specialty_fastsprintrecovery", true, false); self setperk("specialty_fastoffhand", true, false); self setperk("specialty_quickswap", true, false); self.movespeedscalar = 1.2; self maps\mp\gametypes\_weapons::updateMoveSpeedScale(); } display(visible){ if(visible){ self.crankedhud[0].alpha = 0.5; self.crankedhud[1].alpha = 0.5; self.crankedhud[2].alpha = 1; self.crankedhud[3].alpha = 1; self.crankedhud[4].alpha = level.crankedoverlay; }else{ self.crankedhud[0].alpha = 0; self.crankedhud[1].alpha = 0; self.crankedhud[2].alpha = 0; self.crankedhud[3].alpha = 0; self.crankedhud[4].alpha = 0; } } drawtext(text, align, relative, x, y, fontscale, font, color, alpha, sort){ element = self createfontstring(font, fontscale); element setpoint(align, relative, x, y); element.label = text; element.hidewheninmenu = true; element.color = color; element.alpha = alpha; element.sort = sort; element.hidden = true; return element; } drawshader(shader, align, relative, x, y, width, height, color, alpha, sort){ element = newclienthudelem(self); element.elemtype = "icon"; element.hidewheninmenu = true; element.shader = shader; element.width = width; element.height = height; element.align = align; element.relative = relative; element.xoffset = 0; element.yoffset = 0; element.children = []; element.sort = sort; element.color = color; element.alpha = alpha; element setparent(level.uiparent); element setshader(shader, width, height); element setpoint(align, relative, x, y); return element; } drawoverlay(){ element = newclienthudelem(self); element.x = 0; element.y = 0; element.alignX = "left"; element.alignY = "top"; element.horzAlign = "fullscreen"; element.vertAlign = "fullscreen"; element setshader ("combathigh_overlay", 640, 480); element.sort = -10; element.alpha = 0; element.color = (0,1,0); return element; } }
-
Kalitos No, the conditional must go inside the init() function.
#include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\gametypes\_hud_util; /** IW5 Cranked. Updated: 14/06/2021. Version: 1.0. Author: Birchy. Description: IW5 custom script that adds 'cranked' behaviour present in other titles. Works for every gamemode. */ init(){ if(getDvar("g_gametype")=="war") //If is TDM mode { level.crankedtime = 20; level.crankedoverlay = 0.25; level thread connect(); } } connect(){ for(;;){ level waittill("connected", player); player thread cranked(); } } cranked(){ self endon("disconnect"); self.crankedhud[0] = drawshader("white", "TOP", "CENTER", -190, 90, 75, 25, (0.6,0.8,0.6), 0, 1); self.crankedhud[1] = drawshader("white", "TOP", "CENTER", -190, 115, 75, 10, (0,0,0), 0, 1); self.crankedhud[2] = drawtext(&"0:", "TOP", "CENTER", -190, 90, 1, "bigfixed", (1,1,1), 0, 2); self.crankedhud[3] = drawtext(&"CRANKED", "TOP", "CENTER", -190, 114, 1, "objective", (1,1,1), 0, 2); self.crankedhud[4] = drawoverlay(); for(;;){ event = self waittill_any_return("death", "spawned_player", "killed_enemy"); if(event == "killed_enemy"){ self effects(); self display(true); self thread timer(); }else{ self display(false); } } } timer(){ self endon("disconnect"); self endon("death"); self endon("killed_enemy"); time = level.crankedtime; self.crankedhud[2] setvalue(time); self.crankedhud[2].color = (1,1,1); self.crankedhud[2].label = &"0:"; //TODO: Including milliseconds would probably look nice. while(time != 0){ wait 1; time -= 1; self.crankedhud[2] setvalue(time); self playlocalsound("trophy_detect_projectile"); if(time < 10){ self.crankedhud[2].label = &"0:0"; if(time <= 5 && time != 0){ self.crankedhud[2].color = (0.8,0.2,0.2); self playsound("ui_mp_suitcasebomb_timer"); } } } self playsound("detpack_explo_default"); playfx(level.c4death, self.origin); self suicide(); } effects(){ self setperk("specialty_fastermelee", true, false); self setperk("specialty_lightweight", true, false); self setperk("specialty_fastreload", true, false); self setperk("specialty_longersprint", true, false); self setperk("specialty_quickdraw", true, false); self setperk("specialty_stalker", true, false); self setperk("specialty_fastsprintrecovery", true, false); self setperk("specialty_fastoffhand", true, false); self setperk("specialty_quickswap", true, false); self.movespeedscalar = 1.2; self maps\mp\gametypes\_weapons::updateMoveSpeedScale(); } display(visible){ if(visible){ self.crankedhud[0].alpha = 0.5; self.crankedhud[1].alpha = 0.5; self.crankedhud[2].alpha = 1; self.crankedhud[3].alpha = 1; self.crankedhud[4].alpha = level.crankedoverlay; }else{ self.crankedhud[0].alpha = 0; self.crankedhud[1].alpha = 0; self.crankedhud[2].alpha = 0; self.crankedhud[3].alpha = 0; self.crankedhud[4].alpha = 0; } } drawtext(text, align, relative, x, y, fontscale, font, color, alpha, sort){ element = self createfontstring(font, fontscale); element setpoint(align, relative, x, y); element.label = text; element.hidewheninmenu = true; element.color = color; element.alpha = alpha; element.sort = sort; element.hidden = true; return element; } drawshader(shader, align, relative, x, y, width, height, color, alpha, sort){ element = newclienthudelem(self); element.elemtype = "icon"; element.hidewheninmenu = true; element.shader = shader; element.width = width; element.height = height; element.align = align; element.relative = relative; element.xoffset = 0; element.yoffset = 0; element.children = []; element.sort = sort; element.color = color; element.alpha = alpha; element setparent(level.uiparent); element setshader(shader, width, height); element setpoint(align, relative, x, y); return element; } drawoverlay(){ element = newclienthudelem(self); element.x = 0; element.y = 0; element.alignX = "left"; element.alignY = "top"; element.horzAlign = "fullscreen"; element.vertAlign = "fullscreen"; element setshader ("combathigh_overlay", 640, 480); element.sort = -10; element.alpha = 0; element.color = (0,1,0); return element; }
-
Kalitos thank you
-
the_bad_boy next time post your support request in the support section not releases