Raised This Month: $12 Target: $400
 3% 

Custom Nextmap


Post New Thread Reply   
 
Thread Tools Display Modes
shaliwahan
Member
Join Date: Aug 2011
Old 01-01-2012 , 21:57   Re: Custom Nextmap
Reply With Quote #341

Quote:
Then why did you ask if it will work when you know it works?
Because it throws some warnings.. + GHW said that he does not want to made the code more complex, so shared that its working and its just 5-6 lines extra from the original code.. + Wanted to ask if there is a better way to do this or what I have done is perfectly fine? + On all these previous pages many users have asked for the same but none cared to explain them how to do it, I just gave a start..
That's what is community is for.. Sharing and helping....

No offense..
shaliwahan is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-01-2012 , 22:52   Re: Custom Nextmap
Reply With Quote #342

Quote:
Originally Posted by shaliwahan View Post
Because it throws some warnings.. + GHW said that he does not want to made the code more complex, so shared that its working and its just 5-6 lines extra from the original code.. + Wanted to ask if there is a better way to do this or what I have done is perfectly fine? + On all these previous pages many users have asked for the same but none cared to explain them how to do it, I just gave a start..
That's what is community is for.. Sharing and helping....

No offense..
As far as efficiency goes it is a negligible change. About the warnings, we can't help you fix the warnings if you don't tell us what they are or you post your whole code (as an attachment).
__________________
fysiks is offline
shaliwahan
Member
Join Date: Aug 2011
Old 01-02-2012 , 00:30   Re: Custom Nextmap
Reply With Quote #343


Here you go.. Attached the sma.. Custom version..
Checks for gungame enabled else number of players else regular vote.
I get a couple of warnings while compiling..

Thank you for your help...


NOTE: THIS IS NOT THE EXACT SAME VERSION THAT GHW CREATED.. I HAVE EDITED IT AS PER MY REQUIREMENTS.

Last edited by shaliwahan; 01-02-2012 at 01:23.
shaliwahan is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-02-2012 , 00:52   Re: Custom Nextmap
Reply With Quote #344

It's because your indenation is done very poorly.

PHP Code:
        if (get_cvar_num("gg_enabled"))
        {
        
get_configsdir(configfile,199)
        
format(configfile,199,"%s/custom_nextmaps_gungame.ini",configfile)
        }
    else if    (
get_playersnum() < 13)
        {
        
get_configsdir(configfile,199)
        
format(configfile,199,"%s/custom_nextmaps_small.ini",configfile)
        }
    else
        {
        
get_configsdir(configfile,199)
        
format(configfile,199,"%s/custom_nextmaps.ini",configfile)
        } 


PHP Code:
    if (get_cvar_num("gg_enabled"))
    {
        
get_configsdir(configfile,199)
        
format(configfile,199,"%s/custom_nextmaps_gungame.ini",configfile)
    }
    else if (
get_playersnum() < 13)
    {
        
get_configsdir(configfile,199)
        
format(configfile,199,"%s/custom_nextmaps_small.ini",configfile)
    }
    else
    {
        
get_configsdir(configfile,199)
        
format(configfile,199,"%s/custom_nextmaps.ini",configfile)
    } 
__________________
fysiks is offline
shaliwahan
Member
Join Date: Aug 2011
Old 01-02-2012 , 01:22   Re: Custom Nextmap
Reply With Quote #345

Ahahaha.... thanks...
Never took indenation seriously.. will take it from now in
shaliwahan is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-02-2012 , 03:07   Re: Custom Nextmap
Reply With Quote #346

Quote:
Originally Posted by shaliwahan View Post
Ahahaha.... thanks...
Never took indenation seriously.. will take it from now in
Proper indentation is very important for readability and if you ever want people to help you with your code/plugins.
__________________
fysiks is offline
RTG
Senior Member
Join Date: Aug 2010
Location: CZ
Old 01-10-2012 , 10:52   Re: Custom Nextmap
Reply With Quote #347

shaliwahan i like your work, please could you post your code here? or PM me, thanks
RTG is offline
Send a message via ICQ to RTG Send a message via AIM to RTG
shaliwahan
Member
Join Date: Aug 2011
Old 01-19-2012 , 10:47   Re: Custom Nextmap
Reply With Quote #348

Ok! Here we go.. As requested by RTG and other..

The main plugin and the version attached here differs the following changes..

  • Added 3 different conditions for votes.
  • Added empty server random map from maps file
  • Changed version from 1.4d to 1.4f

Files

custom_nextmaps_gungame.ini
To be used in the same way as defined on the first page. Used only when gungame is active.

custom_nextmaps_small.ini
Used when the total number of players are less then 15 when the vote starts.

custom_nextmaps.ini
Default file used in all other cased except the above two mentioned.

Note: Whenever the server is empty and no one votes, a random map is chosen from custom_nextmaps_small.ini

For more details on how to use this plugin see the first page of this thread.
Attached Files
File Type: sma Get Plugin or Get Source (GHW_Custom_Nextmap.sma - 514 views - 15.3 KB)

Last edited by shaliwahan; 01-21-2012 at 20:55.
shaliwahan is offline
RTG
Senior Member
Join Date: Aug 2010
Location: CZ
Old 01-20-2012 , 16:08   Re: Custom Nextmap
Reply With Quote #349

what do you mean by this? thanks
Quote:
Added 3 different conditions for votes.
RTG is offline
Send a message via ICQ to RTG Send a message via AIM to RTG
shaliwahan
Member
Join Date: Aug 2011
Old 01-21-2012 , 02:47   Re: Custom Nextmap
Reply With Quote #350

Quote:
Originally Posted by RTG View Post
what do you mean by this?
  1. GunGame Active/In-Active
  2. Players less then 15
  3. None of the above

Last edited by shaliwahan; 01-21-2012 at 20:55.
shaliwahan 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 18:24.


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