Raised This Month: $51 Target: $400
 12% 

One Map Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
applemes
Senior Member
Join Date: Mar 2013
Old 03-25-2013 , 20:47   One Map Plugin
Reply With Quote #1

Is it possible to enable a plugin for one map only? I have a minigames server, and i am trying to enable a team ratio balance for mg_backalley_run_v2 only. If there is a plugin can someone send me a link? if not can someone help me?
applemes is offline
Skyy
AlliedModders Donor
Join Date: Jan 2010
Location: Toronto, Canada
Old 03-25-2013 , 21:09   Re: One Map Plugin
Reply With Quote #2

decl String:Map[MAP_MAX_LENGTH];
GetCurrentMap(Map, sizeof(Map));
if (!StrEqual(Map, "mapname")) { DisablePlugin }
Skyy is offline
applemes
Senior Member
Join Date: Mar 2013
Old 03-25-2013 , 21:13   Re: One Map Plugin
Reply With Quote #3

skyy, do i put "mapname" for EVERY map i dont want plugin on?
applemes is offline
cREANy0
SourceMod Donor
Join Date: Jul 2012
Location: Germany
Old 03-25-2013 , 21:14   Re: One Map Plugin
Reply With Quote #4

You could use Map Configs Plugin if you want load something for a specific Map:
Code:
https://forums.alliedmods.net/showthread.php?p=607079

Make a Config in cfg/sourcemod/map-cfg name it "mg_backalley_run_v2.cfg" and write this into it :
Code:
sm plugins load disabled/nameofplugin.smx
You have to put the plugin into the disabled folder.



greetz cREANy0
__________________

Last edited by cREANy0; 03-25-2013 at 21:23.
cREANy0 is offline
applemes
Senior Member
Join Date: Mar 2013
Old 03-25-2013 , 21:19   Re: One Map Plugin
Reply With Quote #5

Would this work?

#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
HookEvent("round_start", Event_RoundStart);
}

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
FixTeams();
}

FixTeams()
{
new Float:Ratio;
for(new i = 1; i <= MaxClients; i++)
{
Ratio = Float:GetTeamClientCount(2)/Float:GetTeamClientCount(3)
if(Ratio<=1.6)
{
break;
}
if(IsClientInGame(i)&&GetClientTeam(i)==2)
{
ChangeClientTeam(i, 3);
}
}
}

decl String:Map[MAP_MAX_LENGTH];
GetCurrentMap(Map, sizeof(Map));
if (!StrEqual(Map, "mg_backalley_run_v2")) { DisablePlugin }
applemes is offline
cREANy0
SourceMod Donor
Join Date: Jul 2012
Location: Germany
Old 03-25-2013 , 21:22   Re: One Map Plugin
Reply With Quote #6

No, why do you don't use my way much better and easier...
__________________

Last edited by cREANy0; 03-25-2013 at 21:32.
cREANy0 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode