Raised This Month: $ Target: $400
 0% 

Run the plugin only on 1 map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 10-16-2009 , 14:43   Run the plugin only on 1 map
Reply With Quote #1

Can someone show me a right example how to run a server on only 1 map please?
KadiR is offline
Old 10-16-2009, 14:46
One
This message has been deleted by Emp`. Reason: Stop posting about things you don't understand
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-16-2009 , 14:50   Re: Run the plugin only on 1 map
Reply With Quote #2

http://wiki.amxmodx.org/Configuring_...ecific_Plugins
__________________
xPaw is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 10-16-2009 , 15:10   Re: Run the plugin only on 1 map
Reply With Quote #3

Quote:
Originally Posted by KadiR View Post
Can someone show me a right example how to run a server on only 1 map please?
PHP Code:
public plugin_init( ) {
    
register_plugin("""""")
    
    new 
mapid[32];
    
get_mapname(mapid31);
    
    if(
equali(mapid"MAPNAME HERE"))
    {
    
    }

example: http://forums.alliedmods.net/showthread.php?t=104397

Last edited by lazarev; 10-16-2009 at 15:22.
lazarev is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 10-17-2009 , 04:18   Re: Run the plugin only on 1 map
Reply With Quote #4

I added your code, after register_plugin:

PHP Code:
new mapid[32];
    
get_mapname(mapid31);
    
    if(
equali(mapid"de_dust2"))
    {
    
    }
    
    { 
But the plugin runs on all de_* maps
KadiR is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-17-2009 , 04:37   Re: Run the plugin only on 1 map
Reply With Quote #5

Follow xPaw's post.
__________________
Arkshine is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 10-17-2009 , 05:07   Re: Run the plugin only on 1 map
Reply With Quote #6

Nope, I don't need that, it does fuck up your config files...
Just want a simple code!
KadiR is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-17-2009 , 06:13   Re: Run the plugin only on 1 map
Reply With Quote #7

Quote:
it does fuck up your config files...
What?
__________________
Arkshine is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-17-2009 , 07:23   Re: Run the plugin only on 1 map
Reply With Quote #8

The example that xPaw gives wont mess with your configs files....
It will just act as a plugins.ini file for the specific map it will be alot easier than editing all your plugins and add that code.
micke1101 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-17-2009 , 07:25   Re: Run the plugin only on 1 map
Reply With Quote #9

maybe this here ? :

[SOLVED]check map name/version
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-17-2009 , 09:18   Re: Run the plugin only on 1 map
Reply With Quote #10

Both ways are kinda the same as you will only call register_plugin in lazarev's way and you won't load the plugin at all in xPaw's way.
However, if using lazarev's way, I would recommend using equali with a third parameter (check the funcwiki for this), simply because the map's name may have a "de_" (just an example) in it's middle, if it's german for instance. And before someone argues that contain returns the index and all you should do is check if it's 0, equali is more efficient here.
vitorrd 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:53.


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