Raised This Month: $32 Target: $400
 8% 

Solved Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 02-20-2021 , 07:07   Problem
Reply With Quote #1

Hello I have problem in choosing gamemodes.

So what I did is prevent multi-infection mode in map with "de_" and "cs_" prefix.

While nemesis in "zm_" maps.

So here's the problem:
When I try to join in zombieplague map (zm_), nothing happens, i mean no gamemode is choosed at all. It's just waiting for gamemode but when i try to join in nemesis map (de_), nemesis is playable. I don't know what happens here, please help me to fix it.

in gamemode multi infect file, I put this.
PHP Code:
if((contain(map"de_") != 1) || (contain(map"cs_") != 1) || (contain(map"big_") != -1))
    return 
PLUGIN_HANDLED
then in nemesis file
PHP Code:
if(contain(map"zm_") != -1))
    return 
PLUGIN_HANDLED
EDIT: Problem solved

Solution:
Use this method https://wiki.alliedmods.net/Configur...ecific_Plugins
__________________

Last edited by nG_getwreck; 02-20-2021 at 23:10.
nG_getwreck is offline
Old 02-20-2021, 08:50
Napoleon_be
This message has been deleted by Napoleon_be. Reason: bugsy to the rescue
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-20-2021 , 08:52   Re: Problem
Reply With Quote #2

Please use descriptive topic titles.

de and cs has 1 instead of -1 in your code, and you should use && instead of ||.

Try:
PHP Code:
//Not in de/cs/big map
if((contain(map"de_") == -1) && (contain(map"cs_") == -1) && (contain(map"big_") == -1))
    return 
PLUGIN_HANDLED

//Not in zm map
if(contain(map"zm_") == -1)
    return 
PLUGIN_HANDLED
I would consider using equal() instead, like this, to avoid false positivies if a map was named "funmap_cs_test"
PHP Code:
//Not in de/cs/big map
if ( !equal(map"de_",3) && !equal(map"cs_",3) && !equal(map"big_",4) )
    return 
PLUGIN_HANDLED

//Not in zm map
if ( !equal(map"zm_",3) )
    return 
PLUGIN_HANDLED
__________________

Last edited by Bugsy; 02-20-2021 at 10:56.
Bugsy is offline
Old 02-20-2021, 11:19
nG_getwreck
This message has been deleted by nG_getwreck. Reason: .............
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-20-2021 , 11:23   Re: Problem
Reply With Quote #3

Show your code, this is not that complicated.

PHP Code:
if ( equal(map"zm_",3) )
{
    
//Do stuff for zm maps

__________________
Bugsy is offline
Old 02-20-2021, 11:33
nG_getwreck
This message has been deleted by nG_getwreck.
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-20-2021 , 11:51   Re: Problem
Reply With Quote #4

My guess is your code is stopping before it reaches the map check. Do some debugging on your own by printing logs at different points to see where code stops.

PHP Code:
public zp_fw_gamemodes_choose_pre(game_mode_idskipchecks)
{
    new 
map[64]
    
get_mapname(map63)

    new 
alive_count GetAliveCount()
    
    
// Calculate zombie count with current ratio setting
    
new zombie_count floatround(alive_count get_pcvar_float(cvar_multi_ratio), floatround_ceil)

    if (!
skipchecks)
    {
        
// Random chance
        
if (random_num(1get_pcvar_num(cvar_multi_chance)) != 1)
            return 
PLUGIN_HANDLED;
        
        
// Min players
        
if (alive_count get_pcvar_num(cvar_multi_min_players))
            return 
PLUGIN_HANDLED;
        
        
// Min zombies
        
if (zombie_count get_pcvar_num(cvar_multi_min_zombies))
            return 
PLUGIN_HANDLED;

    }

    
log_amx("checking if zombie map" )

    if((!
equal(map"zm_"3)) && !equal(map"ze_"3))
        return 
PLUGIN_HANDLED;

    
log_amx("zombie map check successful" 
__________________
Bugsy is offline
Old 02-20-2021, 12:03
nG_getwreck
This message has been deleted by nG_getwreck.
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 13:06.


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