AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Maps (https://forums.alliedmods.net/showthread.php?t=118241)

zombieplague 02-09-2010 01:19

Maps
 
How do like this ?

For an example :

When the map is de dust 2 the cvar wil change to 1 ?

drekes 02-09-2010 01:50

Re: Maps
 
addons/amxmodx/config
make a folder called maps.
there make a cfg called "mapname.cfg"
ex: for de_dust2 = de_dust2.cfg
and put your cvar in there. You should have something like this.

addons/amxmodx/configs/maps/de_dust2.cfg

in cfg:

mp_friendlyfire 1
sv_alltalk 0
your cvar 1

zombieplague 02-09-2010 02:40

Re: Maps
 
Quote:

Originally Posted by drekes (Post 1083415)
addons/amxmodx/config
make a folder called maps.
there make a cfg called "mapname.cfg"
ex: for de_dust2 = de_dust2.cfg
and put your cvar in there. You should have something like this.

addons/amxmodx/configs/maps/de_dust2.cfg

in cfg:

mp_friendlyfire 1
sv_alltalk 0
your cvar 1

No i mean like using plugin.

something like this if the map is de dust 2

set_cvar_num( amx_nono ) == 1 )

drekes 02-09-2010 02:49

Re: Maps
 
that's a lot harder i think, you can active a a plugin on a certain map, maybe this helps you out.

addons/amxmodx/config
make a folder called maps
there make a ini called "plugins-mapname.ini"
ex: for de_dust2 = de_dust2.ini
and put your plugins in there. You should have something like this.

addons/amxmodx/configs/maps/plugins-de_dust2.ini

in ini:

ex:
amx_nono.amxx

Merc3y 02-10-2010 01:54

Re: Maps
 
Quote:

Originally Posted by drekes (Post 1083443)
that's a lot harder i think, you can active a a plugin on a certain map, maybe this helps you out.

addons/amxmodx/config
make a folder called maps
there make a ini called "plugins-mapname.ini"
ex: for de_dust2 = de_dust2.ini
and put your plugins in there. You should have something like this.

addons/amxmodx/configs/maps/plugins-de_dust2.ini

in ini:

ex:
amx_nono.amxx

No he mean like this:

If the map is de dust 2

set_cvar_num( amx_nono ) == 1 )

when the map is not dd2 the plugin still on.

zombieplague 02-10-2010 02:06

Re: Maps
 
Quote:

Originally Posted by Merc3y (Post 1084306)
No he mean like this:

If the map is de dust 2

set_cvar_num( amx_nono ) == 1 )

when the map is not dd2 the plugin still on.

Something like that.

I want like this:

If the map is not de dust 2 set_cvar_num( "amx_nono" ) == 0 )

Else if the map is de dust set set_cvar_num( "amx_nono" ) == 1 )

Can someone help me ?

Jack86 02-10-2010 05:01

Re: Maps
 
Try this
PHP Code:

public plugin_cfg()
{
    new 
mapname[32]
    
get_mapname(mapname,charsmax(mapname))
    if(
equali(mapname,"de_dust2") != -1set_cvar_num("amx_nono",1)
    else 
set_cvar_num("amx_nono",0)




zombieplague 02-10-2010 06:12

Re: Maps
 
Quote:

Originally Posted by Jack86 (Post 1084373)
Try this
PHP Code:

public plugin_cfg()
{
    new 
mapname[32]
    
get_mapname(mapname,charsmax(mapname))
    if(
equali(mapname,"de_dust2") != -1set_cvar_num("amx_nono",1)
    else 
set_cvar_num("amx_nono",0)
 



Didn't work

PHP Code:

public plugin_init( )
{
    
register_logevent"logevent_round_start"2"1=Round_Start" )

    
register_cvar"amx_notice""1" )
}

public 
logevent_round_start( )

    if ( 
get_cvar_num"amx_notice" ) == )
    {  
        
// set_task( 1.0 , "z" )
    
}
 
    else if ( 
get_cvar_num"amx_notice" ) == )
    {  
        
// remove_task( )
    
}
}  

public 
plugin_cfg( )
{
    new 
mapname32 ]
    
get_mapnamemapnamecharsmaxmapname ) )
    if ( 
equalimapname"de_dust2" ) != -
    {
        
set_cvar_num"amx_notice")
    }
    else
    {
        
set_cvar_num"amx_notice")
    }



One 02-10-2010 06:28

Re: Maps
 
here you go:

PHP Code:

public plugin_init( )
{
    
register_logevent"logevent_round_start"2"1=Round_Start" )
    
    
register_cvar"amx_notice""1" )
    
    
    new 
mapname32 ]
    
get_mapnamemapnamecharsmaxmapname ) )
    if ( !
equalimapname"de_dust2" ) ) 
    {
        
set_cvar_num"amx_notice")
    }
    else
    {
        
set_cvar_num"amx_notice")
    }
}
public 
logevent_round_start( )

    if ( !
get_cvar_num"amx_notice" ))
    {  
        
// remove_task( )
        
    
}
    
    else
    {  
        
// set_task( 1.0 , "z" )
    
}




All times are GMT -4. The time now is 07:22.

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