Raised This Month: $ Target: $400
 0% 

only de_,cs_


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
m_pro_m
Junior Member
Join Date: Nov 2010
Old 11-23-2010 , 14:17   only de_,cs_
Reply With Quote #1

Hi ...
How i can do so method, whoes will do something only when will be de_ or cs_ map ?
ex. Now is on the server aim_dgl map. Menu -> dont open
ex2. Is map as de_dust2. Menu -> OPEN !

Do you understand ? Thanks
m_pro_m is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2010 , 14:19   Re: only de_,cs_
Reply With Quote #2

Either use per-map plugin feature, or use get_mapname() to check map name for allowed maps.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
m_pro_m
Junior Member
Join Date: Nov 2010
Old 11-23-2010 , 14:24   Re: only de_,cs_
Reply With Quote #3

hm ... but i dont know a name of map ... i need some function whoes will know do it
m_pro_m is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2010 , 14:27   Re: only de_,cs_
Reply With Quote #4

Use get_mapname() and compare the first part to check for "de_" or "cs_".
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
m_pro_m
Junior Member
Join Date: Nov 2010
Old 11-23-2010 , 14:31   Re: only de_,cs_
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
compare the first part to check for "de_" or "cs_".
How ? I am not so good in Pawn :/
m_pro_m is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2010 , 14:41   Re: only de_,cs_
Reply With Quote #6

There are several ways:
- equal(string, compare, length_to_check)
- contain(string, find) or strfind(string, find)
- Or check individual chars: string[0] == 'd' && string[1] == 'e' && string[2] == '_'

For methods 1 & 2, use the funcwiki for information about how to use the functions.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
XLN's | [Lo]Phreak^n^c
Senior Member
Join Date: May 2006
Location: Argentina
Old 11-24-2010 , 06:11   Re: only de_,cs_
Reply With Quote #7

Quote:
Originally Posted by m_pro_m View Post
hm ... but i dont know a name of map ...
you can still use per-map plugin feature as Exolent said (with cs_ or de_ prefixes)

from amxx wiki ( http://wiki.amxmodx.org/index.php/Configuring_AMX_Mod_X )

For example, if you wanted the map de_dust to disable the plugin ham.amxx and enable the plugin pickle.amxx you would put this in amxmodx/configs/maps/plugins-de_dust.ini:
Code:
ham.amxx disabled
pickle.amxx
As of AMX Mod X 1.8.0, you are now able to create plugin.ini files for map prefixes. To do this, create a file called plugins-<prefix>.ini, where <prefix> would mean de, cs, awp, surf, ect. All prefix config files go in the same location as per map, the amxmodx/configs/maps/ directory. configs/maps/plugins-de.ini - Would enable/disable any plugins for all de_* maps.
Plugin based configuration files are loaded by map first (plugins-de_nuke.ini) and prefix second (plugins-de.ini).
__________________
::: If u're 555 then I'm 666 :::
XLN's | [Lo]Phreak^n^c is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 11-23-2010 , 16:09   Re: only de_,cs_
Reply With Quote #8

I believe this would work too:

Code:
new mapname[4] get_mapname( mapname, 3 ) if( equali( mapname, "de_" ) )     // ...
OR
Code:
new mapname[20] get_mapname( mapname, 19 ) mapname[3] = 0 // or is it "\0" or something similar? if( equali( mapname, "de_" ) )     // ...

Correct me if I'm wrong. I'm more confident in the first one being true than the second one.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2010 , 16:32   Re: only de_,cs_
Reply With Quote #9

Those 2 are indeed the same, except the 2nd uses unnecessary memory.

And yes, '\0' = 0, except with Pawn's default escape character it would be '^0'.

There are 2 methods to escape an integer to a char:
1. '\33' where 33 is a decimal integer. This example results in 33 as the decimal integer, which corresponds to the exclamation point character '!'.
2. '\x33' where 33 is a hexadecimal integer. This example results in 51 as the decimal integer, which corresponds to the number 3 character '3'.

See http://www.asciitable.com for more info.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply


Thread Tools
Display Modes

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 11:23.


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