Raised This Month: $ Target: $400
 0% 

Change the number of maps in a map vote


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ghostofmybrain
Veteran Member
Join Date: Mar 2010
Old 06-16-2010 , 18:41   Change the number of maps in a map vote
Reply With Quote #1

I was fooling around with adminvote.sma, trying to make it so that if an admin put up a map vote they could choose more than 4 maps for the vote.

Now, I have absolutely no knowledge of amx scripting. I was just messing around with it, and trying to logically figure out what things I would need to change, and try to find all the instances where these things were referenced. But the bottom line is I have no idea what I'm doing.

I found

Code:
new g_voteCount[4]
and made it

Code:
new g_voteCount[6]
Then I also found

Code:
g_validMaps = 0
	g_optionName[0][0] = 0
	g_optionName[1][0] = 0
	g_optionName[2][0] = 0
	g_optionName[3][0] = 0
and changed it to

Code:
g_validMaps = 0
	g_optionName[0][0] = 0
	g_optionName[1][0] = 0
	g_optionName[2][0] = 0
	g_optionName[3][0] = 0
        g_optionName[4][0] = 0
        g_optionName[5][0] = 0

It compiled fine, but when I tried to pull up a map vote it didn't do anything different. I was still limited to four maps.

Can somebody point me in the right direction for editting this?
ghostofmybrain is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-16-2010 , 18:52   Re: Change the number of maps in a map vote
Reply With Quote #2

Try
PHP Code:
public checkVotes()
{
 new 
best 0
 
 
if (!g_yesNoVote)
 {
  for (new 
04; ++a)
   if (
g_voteCount[a] > g_voteCount[best])
 
  
best a
 
}
 new 
votesNum g_voteCount[0] + g_voteCount[1] + g_voteCount[2] + g_voteCount[3

PHP Code:
public checkVotes()
{
 new 
best 0
 
 
if (!g_yesNoVote)
 {
  for (new 
06; ++a)
   if (
g_voteCount[a] > g_voteCount[best])
 
  
best a
 
}
 new 
votesNum g_voteCount[0] + g_voteCount[1] + g_voteCount[2] + g_voteCount[3] + g_voteCount[4] + g_voteCount[5
and
PHP Code:
if (argc 5argc 

PHP Code:
if (argc 7argc 

Last edited by edgaras85; 06-16-2010 at 18:56.
edgaras85 is offline
ghostofmybrain
Veteran Member
Join Date: Mar 2010
Old 06-16-2010 , 19:13   Re: Change the number of maps in a map vote
Reply With Quote #3

That gave me some errors:

(260) : error 032: array index out of bounds (variable "g_optionName")
(261) : error 032: array index out of bounds (variable "g_optionName")
(344 -- 346) : error 047: array sizes do not match, or destination array is too small
(439 -- 440) : error 047: array sizes do not match, or destination array is too small
(570 -- 572) : error 047: array sizes do not match, or destination array is too small



So I tried editting new g_optionName[4][64] to new g_optionName[6][64]

And every time I saw g_voteCount = {0, 0, 0, 0,} I changed it to g_voteCount = {0, 0, 0, 0, 0, 0}


It compiled that time, but still doesn't allow me to vote for more than 4 maps.

Also, I have no idea what I was doing, I was just changing the lines where it told me there was an error, lol.

Last edited by ghostofmybrain; 06-16-2010 at 19:16.
ghostofmybrain is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-16-2010 , 19:48   Re: Change the number of maps in a map vote
Reply With Quote #4

Try this:

Fixed and Tested.
Attached Files
File Type: sma Get Plugin or Get Source (adminvote.sma - 502 views - 15.9 KB)
__________________

Last edited by fysiks; 06-17-2010 at 00:16.
fysiks is offline
ghostofmybrain
Veteran Member
Join Date: Mar 2010
Old 06-16-2010 , 21:12   Re: Change the number of maps in a map vote
Reply With Quote #5

That didn't work either.
ghostofmybrain is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-16-2010 , 22:40   Re: Change the number of maps in a map vote
Reply With Quote #6

Quote:
Originally Posted by ghostofmybrain View Post
That didn't work either.
What doesn't work about it? Does it compile for you? Are there any errors in the logs? You need to be specific, we can't read your mind.
__________________
fysiks is offline
ghostofmybrain
Veteran Member
Join Date: Mar 2010
Old 06-16-2010 , 22:55   Re: Change the number of maps in a map vote
Reply With Quote #7

I mean I put your plugin on the server and it still does not allow me to choose more than four maps.
ghostofmybrain is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-17-2010 , 00:15   Re: Change the number of maps in a map vote
Reply With Quote #8

Quote:
Originally Posted by ghostofmybrain View Post
I mean I put your plugin on the server and it still does not allow me to choose more than four maps.
According to my testing you are lying to me (kind of). It shows the maps in the vote perfectly fine! And, it works perfectly fine if you choose one of the first 4 options. The only thing that doesn't work is a vote for maps 5 or 6.

It works perfect now.
__________________
fysiks is offline
ghostofmybrain
Veteran Member
Join Date: Mar 2010
Old 06-17-2010 , 19:18   Re: Change the number of maps in a map vote
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
According to my testing you are lying to me (kind of). It shows the maps in the vote perfectly fine! And, it works perfectly fine if you choose one of the first 4 options. The only thing that doesn't work is a vote for maps 5 or 6.

It works perfect now.
Ok, I editted the mapsmenu to allow me to choose 6 instead of 4 maps through the amxmodmenu vote for maps menu, but I'm getting this same problem - any vote for map 5 or map 6 isn't registered.

This is what I have:
Attached Files
File Type: sma Get Plugin or Get Source (mapsmenu.sma - 289 views - 15.0 KB)
ghostofmybrain is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-17-2010 , 19:43   Re: Change the number of maps in a map vote
Reply With Quote #10

Line 60, change 527 to MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|M ENU_KEY_5|MENU_KEY_6
__________________
fysiks is offline
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 14:48.


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