Raised This Month: $ Target: $400
 0% 

Set an additional server cvar in mapchooser.sma


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sparky911
Junior Member
Join Date: Mar 2005
Location: Saskatchewan, Canada
Old 03-11-2005 , 01:50   Set an additional server cvar in mapchooser.sma
Reply With Quote #1

I am editing mapchooser.sma so that on my server after a "next Map Vote" has completed it not only sets the cvar amx_nextmap but also sets a mod specific cvar "agnextmap". Im not sure how to go about this. I tried a few things but was unsuccessful and too new yet. I think this is the area I should be in though...

Code:
public checkVotes() {   new b = 0   for (new a = 0; a < g_mapVoteNum; ++a)     if (g_voteCount[b] < g_voteCount[a])        b = a   if ( g_voteCount[SELECTMAPS] > g_voteCount[b] ) {     new mapname[32]     get_mapname(mapname,31)     new Float:steptime = get_cvar_float("amx_extendmap_step")     set_cvar_float("mp_timelimit", get_cvar_float("mp_timelimit") + steptime )     client_print(0,print_chat,"%L", LANG_PLAYER, "CHO_FIN_EXT", steptime )     log_amx("Vote: Voting for the nextmap finished. Map %s will be extended to next %.0f minutes",       mapname , steptime )     return   }   if ( g_voteCount[b] && g_voteCount[SELECTMAPS+1] <= g_voteCount[b] )       set_cvar_string("amx_nextmap", g_mapName[g_nextName[b]] )   new smap[32]   get_cvar_string("amx_nextmap",smap,31)   client_print(0,print_chat,"%L", LANG_PLAYER, "CHO_FIN_NEXT", smap )   log_amx("Vote: Voting for the nextmap finished. The nextmap will be %s", smap) }
__________________
Sparky911 is offline
Send a message via ICQ to Sparky911 Send a message via MSN to Sparky911
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-11-2005 , 20:55  
Reply With Quote #2

Near the bottom of the code:

Code:
set_cvar_string("amx_nextmap", g_mapName[g_nextName[b]] )

Add another set_cvar_string below it, so it will look like this:

Code:
set_cvar_string("amx_nextmap", g_mapName[g_nextName[b]] ) set_cvar_string("agnextmap", g_mapName[g_nextName[b]] )
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Sparky911
Junior Member
Join Date: Mar 2005
Location: Saskatchewan, Canada
Old 03-11-2005 , 21:40  
Reply With Quote #3

Yea I tried that but after the vote is over it still doesn't set "agnextmap" to the same as amx_nextmap. Plus I get a warning when compiling.

Code:
//AMXXSC compile.exe
// by the AMX Mod X Dev Team


//// agmapchooser.sma
// ...\AMX ModX Scripting\mapchooser.sma(97) : warning 217: loose indentation
// ...\AMX ModX Scripting\agmapchooser.sma(98) : warning 217: loose indentation
//
// 2 Warnings.
// Done.
//
// Compilation Time: 0.59 sec
// ----------------------------------------

Press enter to exit ...
__________________
Sparky911 is offline
Send a message via ICQ to Sparky911 Send a message via MSN to Sparky911
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-12-2005 , 00:27  
Reply With Quote #4

Loose indentations aren't anything to worry about, it just means your text isn't lined up. It doesn't effect the plugin at all, the compiler just nitpicks at you like that. Perhaps, since it is a mod-specific cvar, the mod is overriding it at some point?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Sparky911
Junior Member
Join Date: Mar 2005
Location: Saskatchewan, Canada
Old 03-12-2005 , 11:57  
Reply With Quote #5

Its wierd. I managed to get nextmap.sma to work properly with this mod but can't seem to get mapchooser.sma to. I like AMX Mod X for the ease of kicking and baning so thats the main reason why I use it. I also like the death match mod I am playing. I am hoping to make the 2 work with each other instead of against each other. The mod has its own voting system and nextmap but I don't want to use it I would rather use AMX's.

I got rid of the loose identifier by using { and }. Same results though. It seems to be setting the cvar but to amx's current map not the next one.
__________________
Sparky911 is offline
Send a message via ICQ to Sparky911 Send a message via MSN to Sparky911
Sparky911
Junior Member
Join Date: Mar 2005
Location: Saskatchewan, Canada
Old 03-12-2005 , 13:43  
Reply With Quote #6

I don't think it is the mod overiding it because the modifications I made in nextmap.sma work. When the map loads it sets agnextmap to amx_nextmap. I just can't seem to get mapchooser.sma to do it.

This is what I have tried so far...

Code:
public checkVotes() {   new b = 0   for (new a = 0; a < g_mapVoteNum; ++a)     if (g_voteCount[b] < g_voteCount[a])        b = a   if ( g_voteCount[SELECTMAPS] > g_voteCount[b] ) {     new mapname[32]     get_mapname(mapname,31)     new Float:steptime = get_cvar_float("amx_extendmap_step")     set_cvar_float("mp_timelimit", get_cvar_float("mp_timelimit") + steptime )     client_print(0,print_chat,"%L", LANG_PLAYER, "CHO_FIN_EXT", steptime )     log_amx("Vote: Voting for the nextmap finished. Map %s will be extended to next %.0f minutes",       mapname , steptime )     return   }   if ( g_voteCount[b] && g_voteCount[SELECTMAPS+1] <= g_voteCount[b] )       set_cvar_string("amx_nextmap", g_mapName[g_nextName[b]] )       set_cvar_string("agnextmap", g_mapName[g_nextName[b]] )   new smap[32]   get_cvar_string("amx_nextmap",smap,31)   set_cvar_string("agnextmap",smap,31)   client_print(0,print_chat,"%L", LANG_PLAYER, "CHO_FIN_NEXT", smap )   log_amx("Vote: Voting for the nextmap finished. The nextmap will be %s", smap) }
__________________
Sparky911 is offline
Send a message via ICQ to Sparky911 Send a message via MSN to Sparky911
Sparky911
Junior Member
Join Date: Mar 2005
Location: Saskatchewan, Canada
Old 03-17-2005 , 20:28  
Reply With Quote #7

Still not working
__________________
Sparky911 is offline
Send a message via ICQ to Sparky911 Send a message via MSN to Sparky911
Sparky911
Junior Member
Join Date: Mar 2005
Location: Saskatchewan, Canada
Old 03-20-2005 , 18:24  
Reply With Quote #8

**BUMP**
__________________
Sparky911 is offline
Send a message via ICQ to Sparky911 Send a message via MSN to Sparky911
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-20-2005 , 18:32  
Reply With Quote #9

Quadruple post, nice..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Sparky911
Junior Member
Join Date: Mar 2005
Location: Saskatchewan, Canada
Old 03-20-2005 , 19:22  
Reply With Quote #10

Um ok...

I keep replying to this so it doesn't get forgotten like everyone seems to be trying to do. Im stuck and am still trying things on this subject everyday. Occasionally I come back in hopes that someone has another helpful tip in solving my problem here. Im sure its such a simple solution here but I am most likey too blind to see it. All I am asking for if for someone to point out what I am doing wrong. I'm sure its not a problem with the mod. You can set the cvar "agnextmap" manually in the console so Im certain amx can set it after a next map vote passes at the end of the map. Thats all I ask. Too much?
__________________
Sparky911 is offline
Send a message via ICQ to Sparky911 Send a message via MSN to Sparky911
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 14:01.


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