Raised This Month: $ Target: $400
 0% 

Costume Gamemodes Map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ALonsoVIP4141
Senior Member
Join Date: May 2021
Location: Philippines
Old 06-11-2022 , 18:03   Costume Gamemodes Map
Reply With Quote #1

Welcome,

I want to know how to select a specific map in which Game modes like nemesis and etc are activated

Example:

if the map started with ( de_ ) will be only for Game modes like nemesis and assassin and etc......


Zombie Plague 5.0
ALonsoVIP4141 is offline
Send a message via ICQ to ALonsoVIP4141 Send a message via AIM to ALonsoVIP4141 Send a message via Yahoo to ALonsoVIP4141 Send a message via Skype™ to ALonsoVIP4141
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-11-2022 , 18:09   Re: Costume Gamemodes Map
Reply With Quote #2

Quote:
Originally Posted by ALonsoVIP4141 View Post
Welcome,

I want to know how to select a specific map in which Game modes like nemesis and etc are activated

Example:

if the map started with ( de_ ) will be only for Game modes like nemesis and assassin and etc......


Zombie Plague 5.0
PHP Code:
RunMod( .... )
{
    if( 
IsMapAvailable"de_" ) )
    {
        
// Your code.....
    
}
}

bool:IsMapAvailable( const szMapHandler[ ] )
{
    new 
szMap32 ];
    
get_mapnameszMapcharsmaxszMap ) )
    return ( 
containszMapszMapHandler ) != ) ? true false

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 06-11-2022 at 18:20.
Supremache is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 06-12-2022 , 02:29   Re: Costume Gamemodes Map
Reply With Quote #3

https://wiki.alliedmods.net/Configur...ecific_Plugins
ZaX is offline
ALonsoVIP4141
Senior Member
Join Date: May 2021
Location: Philippines
Old 06-12-2022 , 19:08   Re: Costume Gamemodes Map
Reply With Quote #4

Quote:
Originally Posted by Supremache View Post
PHP Code:
RunMod( .... )
{
    if( 
IsMapAvailable"de_" ) )
    {
        
// Your code.....
    
}
}

bool:IsMapAvailable( const szMapHandler[ ] )
{
    new 
szMap32 ];
    
get_mapnameszMapcharsmaxszMap ) )
    return ( 
containszMapszMapHandler ) != ) ? true false


Can i have an example for im not rely good at ZP 5.0
ALonsoVIP4141 is offline
Send a message via ICQ to ALonsoVIP4141 Send a message via AIM to ALonsoVIP4141 Send a message via Yahoo to ALonsoVIP4141 Send a message via Skype™ to ALonsoVIP4141
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-12-2022 , 19:19   Re: Costume Gamemodes Map
Reply With Quote #5

Quote:
Originally Posted by ALonsoVIP4141 View Post
Can i have an example for im not rely good at ZP 5.0
Open the plugin with the name "zp50_gamemode_nemesis.sma" and replace this function

PHP Code:
public plugin_precache()
{
    
// Register game mode at precache (plugin gets paused after this)
    
register_plugin("[ZP] Game Mode: Nemesis"ZP_VERSION_STRING"ZP Dev Team")
    
zp_gamemodes_register("Nemesis Mode")
    
    
// Create the HUD Sync Objects
    
g_HudSync CreateHudSyncObj()
    
    
g_MaxPlayers get_maxplayers()
    
    
cvar_nemesis_chance register_cvar("zp_nemesis_chance""20")
    
cvar_nemesis_min_players register_cvar("zp_nemesis_min_players""0")
    
cvar_nemesis_show_hud register_cvar("zp_nemesis_show_hud""1")
    
cvar_nemesis_sounds register_cvar("zp_nemesis_sounds""1")
    
cvar_nemesis_allow_respawn register_cvar("zp_nemesis_allow_respawn""0")
    
    
// Initialize arrays
    
g_sound_nemesis ArrayCreate(SOUND_MAX_LENGTH1)
    
    
// Load from external file
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND NEMESIS"g_sound_nemesis)
    
    
// If we couldn't load custom sounds from file, use and save default ones
    
new index
    
if (ArraySize(g_sound_nemesis) == 0)
    {
        for (
index 0index sizeof sound_nemesisindex++)
            
ArrayPushString(g_sound_nemesissound_nemesis[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND NEMESIS"g_sound_nemesis)
    }
    
    
// Precache sounds
    
new sound[SOUND_MAX_LENGTH]
    for (
index 0index ArraySize(g_sound_nemesis); index++)
    {
        
ArrayGetString(g_sound_nemesisindexsoundcharsmax(sound))
        if (
equal(sound[strlen(sound)-4], ".mp3"))
        {
            
format(soundcharsmax(sound), "sound/%s"sound)
            
precache_generic(sound)
        }
        else
            
precache_sound(sound)
    }



PHP Code:
public plugin_precache()
{
    if( !
IsMapAvailable"de_" ) )
    {
        return; 
// If the map is not "de_*" blocks this plugin.
    
}

    
// Register game mode at precache (plugin gets paused after this)
    
register_plugin("[ZP] Game Mode: Nemesis"ZP_VERSION_STRING"ZP Dev Team")
    
zp_gamemodes_register("Nemesis Mode")
    
    
// Create the HUD Sync Objects
    
g_HudSync CreateHudSyncObj()
    
    
g_MaxPlayers get_maxplayers()
    
    
cvar_nemesis_chance register_cvar("zp_nemesis_chance""20")
    
cvar_nemesis_min_players register_cvar("zp_nemesis_min_players""0")
    
cvar_nemesis_show_hud register_cvar("zp_nemesis_show_hud""1")
    
cvar_nemesis_sounds register_cvar("zp_nemesis_sounds""1")
    
cvar_nemesis_allow_respawn register_cvar("zp_nemesis_allow_respawn""0")
    
    
// Initialize arrays
    
g_sound_nemesis ArrayCreate(SOUND_MAX_LENGTH1)
    
    
// Load from external file
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND NEMESIS"g_sound_nemesis)
    
    
// If we couldn't load custom sounds from file, use and save default ones
    
new index
    
if (ArraySize(g_sound_nemesis) == 0)
    {
        for (
index 0index sizeof sound_nemesisindex++)
            
ArrayPushString(g_sound_nemesissound_nemesis[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND NEMESIS"g_sound_nemesis)
    }
    
    
// Precache sounds
    
new sound[SOUND_MAX_LENGTH]
    for (
index 0index ArraySize(g_sound_nemesis); index++)
    {
        
ArrayGetString(g_sound_nemesisindexsoundcharsmax(sound))
        if (
equal(sound[strlen(sound)-4], ".mp3"))
        {
            
format(soundcharsmax(sound), "sound/%s"sound)
            
precache_generic(sound)
        }
        else
            
precache_sound(sound)
    }
}
bool:IsMapAvailable( const szMapHandler[ ] )
{
    new 
szMap32 ];
    
get_mapnameszMapcharsmaxszMap ) )
    return ( 
containszMapszMapHandler ) != ) ? true false

Or use another method that was shared by ZaX
Create a new file in this location addons/amxmodx/configs/maps with name "plugins-de.ini" and type the name of the plugin that you want to make it work on "de" maps like this:

zp50_gamemode_nemesis.amxx
zp50_gamemode_survivor.amxx
etc...

Note: If you are going to use the second method, remember to remove the plugin you added in "plugins-de.ini" from "plugins.ini"
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 06-12-2022 at 19:22.
Supremache is offline
ALonsoVIP4141
Senior Member
Join Date: May 2021
Location: Philippines
Old 06-12-2022 , 19:31   Re: Costume Gamemodes Map
Reply With Quote #6

Quote:
Originally Posted by Supremache View Post
Open the plugin with the name "zp50_gamemode_nemesis.sma" and replace this function

PHP Code:
public plugin_precache()
{
    
// Register game mode at precache (plugin gets paused after this)
    
register_plugin("[ZP] Game Mode: Nemesis"ZP_VERSION_STRING"ZP Dev Team")
    
zp_gamemodes_register("Nemesis Mode")
    
    
// Create the HUD Sync Objects
    
g_HudSync CreateHudSyncObj()
    
    
g_MaxPlayers get_maxplayers()
    
    
cvar_nemesis_chance register_cvar("zp_nemesis_chance""20")
    
cvar_nemesis_min_players register_cvar("zp_nemesis_min_players""0")
    
cvar_nemesis_show_hud register_cvar("zp_nemesis_show_hud""1")
    
cvar_nemesis_sounds register_cvar("zp_nemesis_sounds""1")
    
cvar_nemesis_allow_respawn register_cvar("zp_nemesis_allow_respawn""0")
    
    
// Initialize arrays
    
g_sound_nemesis ArrayCreate(SOUND_MAX_LENGTH1)
    
    
// Load from external file
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND NEMESIS"g_sound_nemesis)
    
    
// If we couldn't load custom sounds from file, use and save default ones
    
new index
    
if (ArraySize(g_sound_nemesis) == 0)
    {
        for (
index 0index sizeof sound_nemesisindex++)
            
ArrayPushString(g_sound_nemesissound_nemesis[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND NEMESIS"g_sound_nemesis)
    }
    
    
// Precache sounds
    
new sound[SOUND_MAX_LENGTH]
    for (
index 0index ArraySize(g_sound_nemesis); index++)
    {
        
ArrayGetString(g_sound_nemesisindexsoundcharsmax(sound))
        if (
equal(sound[strlen(sound)-4], ".mp3"))
        {
            
format(soundcharsmax(sound), "sound/%s"sound)
            
precache_generic(sound)
        }
        else
            
precache_sound(sound)
    }



PHP Code:
public plugin_precache()
{
    if( !
IsMapAvailable"de_" ) )
    {
        return; 
// If the map is not "de_*" blocks this plugin.
    
}

    
// Register game mode at precache (plugin gets paused after this)
    
register_plugin("[ZP] Game Mode: Nemesis"ZP_VERSION_STRING"ZP Dev Team")
    
zp_gamemodes_register("Nemesis Mode")
    
    
// Create the HUD Sync Objects
    
g_HudSync CreateHudSyncObj()
    
    
g_MaxPlayers get_maxplayers()
    
    
cvar_nemesis_chance register_cvar("zp_nemesis_chance""20")
    
cvar_nemesis_min_players register_cvar("zp_nemesis_min_players""0")
    
cvar_nemesis_show_hud register_cvar("zp_nemesis_show_hud""1")
    
cvar_nemesis_sounds register_cvar("zp_nemesis_sounds""1")
    
cvar_nemesis_allow_respawn register_cvar("zp_nemesis_allow_respawn""0")
    
    
// Initialize arrays
    
g_sound_nemesis ArrayCreate(SOUND_MAX_LENGTH1)
    
    
// Load from external file
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND NEMESIS"g_sound_nemesis)
    
    
// If we couldn't load custom sounds from file, use and save default ones
    
new index
    
if (ArraySize(g_sound_nemesis) == 0)
    {
        for (
index 0index sizeof sound_nemesisindex++)
            
ArrayPushString(g_sound_nemesissound_nemesis[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND NEMESIS"g_sound_nemesis)
    }
    
    
// Precache sounds
    
new sound[SOUND_MAX_LENGTH]
    for (
index 0index ArraySize(g_sound_nemesis); index++)
    {
        
ArrayGetString(g_sound_nemesisindexsoundcharsmax(sound))
        if (
equal(sound[strlen(sound)-4], ".mp3"))
        {
            
format(soundcharsmax(sound), "sound/%s"sound)
            
precache_generic(sound)
        }
        else
            
precache_sound(sound)
    }
}
bool:IsMapAvailable( const szMapHandler[ ] )
{
    new 
szMap32 ];
    
get_mapnameszMapcharsmaxszMap ) )
    return ( 
containszMapszMapHandler ) != ) ? true false

Or use another method that was shared by ZaX
Create a new file in this location addons/amxmodx/configs/maps with name "plugins-de.ini" and type the name of the plugin that you want to make it work on "de" maps like this:

zp50_gamemode_nemesis.amxx
zp50_gamemode_survivor.amxx
etc...

Note: If you are going to use the second method, remember to remove the plugin you added in "plugins-de.ini" from "plugins.ini"


Thanks for the quick reply..

I will try both ways
ALonsoVIP4141 is offline
Send a message via ICQ to ALonsoVIP4141 Send a message via AIM to ALonsoVIP4141 Send a message via Yahoo to ALonsoVIP4141 Send a message via Skype™ to ALonsoVIP4141
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 12:55.


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