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

Map specific commands


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:          Approver:   EKS (166)
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 08-14-2005 , 08:25   Map specific commands
Reply With Quote #1

This plugin executes map specific commands an can be configured in great detail.

Commands and CVars:
Code:
amx_mapcfg           will execute the map specific configuration when the cmd is exec'ed by an admin with ADMIN_CFG level.
amx_mapcfg_execed    add this to your config.cfg. The script waits for this cvar to become 1 b4 it does anything automatically, so it can wait for your server.cfg to be executed.
All commands for the maps are stored in a general config file (default: addons/amxmodx/config/mapcommands.txt). If this does not exists by the time the script is executed, it will be created and commented a little.

To setup the map config file, you need to specify the following:
Map names can be specified two ways, open map name and closed map name. This means:
Open map names are defined by putting [mapname into a line. This is used to give commands that are executed on every map whose name starts with the given string, for example:
[fy_ <-- no closing bracket!!!
commands that follow this map name will be executed on fy_pool_day, fy_iceworld, fy_iceworld2k, fy_whathaveyou.

Closed Map names are names that have to be fully equal with the name of the map currently running. For example:
[fy_iceworld] <-- notice the closing bracket!!!
those commands will only be executed on fy_iceworld but NOT on fy_iceworld2k.

There are several directives telling the script where to execute the commands:
#all means that the commands following after this lines are both executed server- and clientside.
#server means that those commands are only executed serverside (this is the default if none is specified).
#client means that these commands are only executed clientside.

Listen servers are not handled the normal way, because they are identical to the first player in the server, so commands being sent to #client would be executed on the server as well, and those sent to #all would be sent to the server twice. To avoid this, the script detects listen servers and does not send the command to the user with uID #1.
But if you do intend to send the command to everybody even if the server will receive the command (twice), you have to use the following directives:
#ignorelisten on
#ignorelisten off
All commands that follow such a line are affected by it, the dedicated server will just ignore them. Commands that come after an '#ignorelisten on' line will be sent so all clients no matter what, #ignorelisten off switches back to normal.

To write a comment, you have to put // to the beginning of the line. Comments are only regarded as such if this token is right at the beginning, lines like
#server // bla
will cause the script to react awkwardly!

I didn't use any mod specific code but yet I have to admit I only tested it on CS 1.6, but I think other mods should work as well...

Attached to this post you will find an example command file which only gives you a couple of messages on the console, but I suppose you know what to do after you read it...

BTW: Double quotes inside the command lines are allowed.

Greetz MGee
Attached Files
File Type: sma Get Plugin or Get Source (mapconfig.sma - 2745 views - 5.1 KB)
File Type: txt mapcommands.txt (2.1 KB, 1812 views)
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-14-2005 , 12:27  
Reply With Quote #2

Mind if I use part of this for my surf tools plugin?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 08-14-2005 , 13:32  
Reply With Quote #3

np with me
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
GeezYz
Junior Member
Join Date: Dec 2005
Old 12-26-2005 , 21:51  
Reply With Quote #4

Danke, genau das hab ich gesucht ;)
GeezYz is offline
Send a message via ICQ to GeezYz
PsychoZone.dk
Junior Member
Join Date: Oct 2005
Old 02-27-2006 , 20:37  
Reply With Quote #5

Hi, sounds nice... I was thinking if you can use this plugin, for eg. make HE restrictions on maps like fy_, fun maps, and de_rats???
And maybe define specific timelimits on some speciel maps???
PsychoZone.dk is offline
PsychoZone.dk
Junior Member
Join Date: Oct 2005
Old 03-07-2006 , 14:42  
Reply With Quote #6

Is this post dead?
PsychoZone.dk is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-07-2006 , 15:51  
Reply With Quote #7

Code:
Mista Gee: Last Visit:   	28 Feb 2006
If he checks here he might say something.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
beezkneez2006
Senior Member
Join Date: Feb 2006
Location: USA
Old 04-01-2006 , 17:09  
Reply With Quote #8

im kinda confused with this.. how do i make it so that on my map de_spiderman_b1 it uses a config that has amx_hook 1 (to turn on hook mod) then when it goes to any other map on the server it just has a config but with amx_hook 0 in it..?
__________________
Code:
#include <gabenmodx>
http://www.czclansp.com
CSDM 2.10 + amxmodx 1.75
72.36.157.100:27015
Fast download 20 man.
beezkneez2006 is offline
Send a message via AIM to beezkneez2006
pendragon
Senior Member
Join Date: Mar 2004
Location: In a bubble
Old 04-01-2006 , 17:55  
Reply With Quote #9

could you not achieve the same affect by placing your commands in a maps' cfg file in the addons\amxmodx\configs\maps dir?
__________________
pendragon is offline
Send a message via ICQ to pendragon
pr3d4t0r
Member
Join Date: Oct 2005
Location: Hungary
Old 04-02-2006 , 16:10  
Reply With Quote #10

Thats nice, but where is the plugin?
pr3d4t0r is offline
Send a message via Skype™ to pr3d4t0r
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 06:49.


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